shenzye46 commited on
Commit
5efc175
·
verified ·
1 Parent(s): 5299779

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +1 -1
app.py CHANGED
@@ -20,7 +20,7 @@ def generate_recipe(recipe_name):
20
  """Generate cooking method given a recipe name."""
21
  prompt = f"Recipe Name: {recipe_name}\nInstructions: "
22
  inputs = tokenizer(prompt, return_tensors="pt")
23
- outputs = model.generate(inputs["input_ids"], max_length=512,temperature=0.2, # Sampling randomness
24
  top_p=0.9, num_return_sequences=1, do_sample=True)
25
  generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
26
  # Return only the method part, splitting after 'Method:'
 
20
  """Generate cooking method given a recipe name."""
21
  prompt = f"Recipe Name: {recipe_name}\nInstructions: "
22
  inputs = tokenizer(prompt, return_tensors="pt")
23
+ outputs = model.generate(inputs["input_ids"], max_length=512,temperature=0.7, # Sampling randomness
24
  top_p=0.9, num_return_sequences=1, do_sample=True)
25
  generated_text = tokenizer.decode(outputs[0], skip_special_tokens=True)
26
  # Return only the method part, splitting after 'Method:'