Spaces:
Paused
Paused
CreitinGameplays
commited on
Commit
•
89a382b
1
Parent(s):
88185d8
Update app.py
Browse files
app.py
CHANGED
@@ -10,6 +10,7 @@ import torch
|
|
10 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
11 |
|
12 |
DESCRIPTION = "# ConvAI 9b"
|
|
|
13 |
|
14 |
if not torch.cuda.is_available():
|
15 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
@@ -20,7 +21,7 @@ MAX_INPUT_TOKEN_LENGTH = int(os.getenv("MAX_INPUT_TOKEN_LENGTH", "4096"))
|
|
20 |
|
21 |
if torch.cuda.is_available():
|
22 |
model_id = "CreitinGameplays/ConvAI-9b"
|
23 |
-
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
24 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
25 |
|
26 |
@spaces.GPU
|
|
|
10 |
from transformers import AutoModelForCausalLM, AutoTokenizer, TextIteratorStreamer
|
11 |
|
12 |
DESCRIPTION = "# ConvAI 9b"
|
13 |
+
hf_token = os.getenv("hf_token")
|
14 |
|
15 |
if not torch.cuda.is_available():
|
16 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
|
|
21 |
|
22 |
if torch.cuda.is_available():
|
23 |
model_id = "CreitinGameplays/ConvAI-9b"
|
24 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto", auth_token=hf_token)
|
25 |
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
26 |
|
27 |
@spaces.GPU
|