Spaces:
Sleeping
Sleeping
Commit
·
4526b2c
1
Parent(s):
e157eab
first version
Browse files
app.py
CHANGED
@@ -33,14 +33,14 @@ if not torch.cuda.is_available():
|
|
33 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
34 |
|
35 |
|
36 |
-
if torch.cuda.is_available():
|
37 |
-
|
38 |
-
|
39 |
-
|
40 |
-
|
41 |
|
42 |
|
43 |
-
@spaces.GPU
|
44 |
def generate(
|
45 |
message: str,
|
46 |
chat_history: list[tuple[str, str]],
|
|
|
33 |
DESCRIPTION += "\n<p>Running on CPU 🥶 This demo does not work on CPU.</p>"
|
34 |
|
35 |
|
36 |
+
# if torch.cuda.is_available():
|
37 |
+
model_id = "meta-llama/Llama-2-7b-chat-hf"
|
38 |
+
model = AutoModelForCausalLM.from_pretrained(model_id, torch_dtype=torch.float16, device_map="auto")
|
39 |
+
tokenizer = AutoTokenizer.from_pretrained(model_id)
|
40 |
+
tokenizer.use_default_system_prompt = False
|
41 |
|
42 |
|
43 |
+
# @spaces.GPU
|
44 |
def generate(
|
45 |
message: str,
|
46 |
chat_history: list[tuple[str, str]],
|