Spaces:
Running
on
Zero
Running
on
Zero
Update app.py
Browse files
app.py
CHANGED
@@ -32,7 +32,7 @@ try:
|
|
32 |
model = AutoModelForCausalLM.from_pretrained(
|
33 |
repo_name,
|
34 |
device_map="auto",
|
35 |
-
torch_dtype=torch.
|
36 |
)
|
37 |
except Exception as e:
|
38 |
print(f"Error loading model with GPU: {e}")
|
@@ -59,7 +59,7 @@ def generate_response(message, history):
|
|
59 |
return "Sorry, the model could not be loaded. Please check the logs."
|
60 |
|
61 |
messages = [
|
62 |
-
{"role": "system", "content": "You are a helpful assistant. You think loud before answering anything"},
|
63 |
]
|
64 |
|
65 |
# Add chat history to messages
|
|
|
32 |
model = AutoModelForCausalLM.from_pretrained(
|
33 |
repo_name,
|
34 |
device_map="auto",
|
35 |
+
torch_dtype=torch.bfloat16,
|
36 |
)
|
37 |
except Exception as e:
|
38 |
print(f"Error loading model with GPU: {e}")
|
|
|
59 |
return "Sorry, the model could not be loaded. Please check the logs."
|
60 |
|
61 |
messages = [
|
62 |
+
{"role": "system", "content": "You are a helpful assistant. You think out loud before answering anything"},
|
63 |
]
|
64 |
|
65 |
# Add chat history to messages
|