Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -101,10 +101,11 @@ def stream_chat(message, history: list, temperature: float, max_length: int, top
|
|
101 |
|
102 |
model = AutoModelForCausalLM.from_pretrained(
|
103 |
MODEL_ID,
|
104 |
-
torch_dtype=torch.
|
105 |
-
|
106 |
-
|
107 |
)
|
|
|
108 |
|
109 |
print(f'message is - {message}')
|
110 |
print(f'history is - {history}')
|
@@ -243,7 +244,7 @@ with gr.Blocks(css=CSS, theme="soft", fill_height=True) as demo:
|
|
243 |
),
|
244 |
],
|
245 |
),
|
246 |
-
gr.
|
247 |
|
248 |
if __name__ == "__main__":
|
249 |
|
|
|
101 |
|
102 |
model = AutoModelForCausalLM.from_pretrained(
|
103 |
MODEL_ID,
|
104 |
+
torch_dtype=torch.float32, # Use float32 for CPU
|
105 |
+
trust_remote_code=True,
|
106 |
+
low_cpu_mem_usage=True # Optimize for CPU
|
107 |
)
|
108 |
+
|
109 |
|
110 |
print(f'message is - {message}')
|
111 |
print(f'history is - {history}')
|
|
|
244 |
),
|
245 |
],
|
246 |
),
|
247 |
+
#gr.LExamples(EXAMPES, [chat_input])
|
248 |
|
249 |
if __name__ == "__main__":
|
250 |
|