Shreyas094 commited on
Commit
463f840
1 Parent(s): 2e526cd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -32,8 +32,8 @@ text_input = "How did Tesla perform in Q1 2024?"
32
  # Tokenize the input text
33
  inputs = tokenizer(text_input, return_tensors="pt").to(device)
34
 
35
- # Generate a response
36
- outputs = model.generate(**inputs, max_length=150, temperature=0.7, top_p=0.9, top_k=50)
37
 
38
  # Decode the generated tokens to a readable string
39
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)
 
32
  # Tokenize the input text
33
  inputs = tokenizer(text_input, return_tensors="pt").to(device)
34
 
35
+ # Generate a response without sampling (deterministic)
36
+ outputs = model.generate(**inputs, max_length=150, do_sample=False)
37
 
38
  # Decode the generated tokens to a readable string
39
  response = tokenizer.decode(outputs[0], skip_special_tokens=True)