Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ model = pipeline("text-generation", model="distilgpt2", device="cpu")
|
|
| 8 |
def generate_text(message, history):
|
| 9 |
try:
|
| 10 |
response = model(message, max_length=50, num_return_sequences=1, do_sample=True, temperature=0.7)
|
| 11 |
-
return response[0]["generated_text"]
|
| 12 |
except Exception as e:
|
| 13 |
return f"Error: {str(e)}"
|
| 14 |
|
|
|
|
| 8 |
def generate_text(message, history):
|
| 9 |
try:
|
| 10 |
response = model(message, max_length=50, num_return_sequences=1, do_sample=True, temperature=0.7)
|
| 11 |
+
return response[0]["generated_text"] # Truncate to fit ESP32
|
| 12 |
except Exception as e:
|
| 13 |
return f"Error: {str(e)}"
|
| 14 |
|