jatinsabari commited on
Commit
5f4f3a8
·
verified ·
1 Parent(s): 072a712

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
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"][:100] # Truncate to fit ESP32
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