File tree Expand file tree Collapse file tree 19 files changed +119
-2
lines changed
androidTest/java/org/pytorch/torchchat
test/java/org/pytorch/torchchat Expand file tree Collapse file tree 19 files changed +119
-2
lines changed Original file line number Diff line number Diff line change 18
18
19
19
# If you keep the line number information, uncomment this to
20
20
# hide the original source file name.
21
- #-renamesourcefileattribute SourceFile
21
+ #-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
1
8
package org .pytorch .torchchat ;
2
9
3
10
import androidx .test .ext .junit .runners .AndroidJUnit4 ;
Original file line number Diff line number Diff line change
1
+ <!--
2
+ Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ All rights reserved.
4
+
5
+ This source code is licensed under the BSD-style license found in the
6
+ LICENSE file in the root directory of this source tree.
7
+ -->
1
8
<?xml version =" 1.0" encoding =" utf-8" ?>
2
9
<manifest xmlns : android =" http://schemas.android.com/apk/res/android"
3
10
xmlns : tools =" http://schemas.android.com/tools" >
Original file line number Diff line number Diff line change
1
+ /*
2
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ * All rights reserved.
4
+ *
5
+ * This source code is licensed under the BSD-style license found in the
6
+ * LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
package org .pytorch .torchchat ;
2
10
3
11
import org .junit .Test ;
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
# Project-wide Gradle settings.
2
8
# IDE (e.g. Android Studio) users:
3
9
# Gradle settings configured through the IDE *will override*
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
# Thu Apr 25 21:54:24 PDT 2024
2
8
distributionBase =GRADLE_USER_HOME
3
9
distributionPath =wrapper/dists
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
import subprocess
2
8
import sys
3
9
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
import torch
2
8
import torch .nn as nn
3
9
from torch ._inductor .codecache import AsyncCompile
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
import torch
2
8
import torch .nn as nn
3
9
from executorch .extension .pybindings import portable_lib as exec_lib
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
import torch
2
8
from build .model import apply_rotary_emb , Attention
3
9
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
from typing import Optional
2
8
3
9
import torch
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
1
8
cmake_minimum_required(VERSION 3.24)
2
9
set(CMAKE_CXX_STANDARD 17)
3
10
IF(DEFINED ENV{TORCHCHAT_ROOT})
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ # All rights reserved.
4
+ #
5
+ # This source code is licensed under the BSD-style license found in the
6
+ # LICENSE file in the root directory of this source tree.
7
+
1
8
cmake_minimum_required(VERSION 3.24)
2
9
set(CMAKE_CXX_STANDARD 17)
3
10
Original file line number Diff line number Diff line change
1
+ /*
2
+ Copyright (c) Meta Platforms, Inc. and affiliates.
3
+ All rights reserved.
4
+
5
+ This source code is licensed under the license found in the
6
+ LICENSE file in the root directory of this source tree.
7
+ */
8
+
1
9
/* Inference for Llama-2 Transformer model in pure C++ */
2
10
#include < ctype.h>
3
11
#include < math.h>
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
#!/usr/bin/env python3
2
8
# Delete me after triton is updated past https://github.com/triton-lang/triton/pull/3564
3
9
Original file line number Diff line number Diff line change 1
- python3 scripts/download.py --repo-id $1 && python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+ python3 scripts/download.py --repo-id $1 && python3 scripts/convert_hf_checkpoint.py --checkpoint-dir checkpoints/$1
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
export MODEL_REPO=meta-llama/Llama-2-7b-chat-hf
2
8
rm -r checkpoints/$MODEL_REPO
3
9
python3 scripts/download.py --repo-id $MODEL_REPO
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
7
+
1
8
import argparse
2
9
import os
3
10
import re
Original file line number Diff line number Diff line change
1
+ # Copyright (c) Meta Platforms, Inc. and affiliates.
2
+ # All rights reserved.
3
+
4
+ # This source code is licensed under the license found in the
5
+ # LICENSE file in the root directory of this source tree.
6
+
1
7
from time import perf_counter
2
8
from typing import Optional
3
9
You can’t perform that action at this time.
0 commit comments