Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -6,9 +6,9 @@ import spaces
|
|
6 |
import torch
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
8 |
DESCRIPTION = """\
|
9 |
-
# Llama-3.1-70B
|
10 |
|
11 |
-
This is a demo of
|
12 |
|
13 |
Enter your text in the box below and click "Complete" to have the AI generate a completion for your input. The generated text will be appended to your input. You can stop the generation at any time by clicking the "Stop" button.
|
14 |
"""
|
@@ -18,7 +18,7 @@ DEFAULT_MAX_NEW_TOKENS = 1024
|
|
18 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
19 |
|
20 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
21 |
-
model_id = "meta-llama/Llama-3.
|
22 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
23 |
model = AutoModelForCausalLM.from_pretrained(
|
24 |
model_id,
|
|
|
6 |
import torch
|
7 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
8 |
DESCRIPTION = """\
|
9 |
+
# Llama-3.1-70B
|
10 |
|
11 |
+
This is a demo of text completion with AI LLM's.
|
12 |
|
13 |
Enter your text in the box below and click "Complete" to have the AI generate a completion for your input. The generated text will be appended to your input. You can stop the generation at any time by clicking the "Stop" button.
|
14 |
"""
|
|
|
18 |
MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
19 |
|
20 |
device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu")
|
21 |
+
model_id = "meta-llama/Llama-3.1-70B"
|
22 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
23 |
model = AutoModelForCausalLM.from_pretrained(
|
24 |
model_id,
|