shenzye46 commited on
Commit
5d72c4c
·
verified ·
1 Parent(s): c06025a

Update app.py

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