CR7CAD commited on
Commit
8fd793d
·
verified ·
1 Parent(s): 1239100

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -49,7 +49,7 @@ def text2story(caption, _models):
49
  # Updated prompt includes explicit instructions to incorporate details from the caption
50
  prompt = (
51
  "<|system|>\n"
52
- "You are a creative story generating assistant that only gives me a story based on image caption given, no reply needed.\n"
53
  "<|user|>\n"
54
  f"Please generate a short story within 100 words that clearly utilizes the following image caption and expands upon it thoroughly:\n\"{caption}\"\n"
55
  "<|assistant|>"
@@ -58,7 +58,7 @@ def text2story(caption, _models):
58
  # Generate story with parameters tuned for creativity and coherence
59
  response = story_generator(
60
  prompt,
61
- max_new_tokens=100, # Enough tokens for a complete story
62
  do_sample=True,
63
  temperature=0.7, # Balanced creativity
64
  top_p=0.9, # Focus on more likely tokens for coherence
 
49
  # Updated prompt includes explicit instructions to incorporate details from the caption
50
  prompt = (
51
  "<|system|>\n"
52
+ "You are a creative story generating assistant that only gives me a happy story based on image caption given, no reply and quotation needed.\n"
53
  "<|user|>\n"
54
  f"Please generate a short story within 100 words that clearly utilizes the following image caption and expands upon it thoroughly:\n\"{caption}\"\n"
55
  "<|assistant|>"
 
58
  # Generate story with parameters tuned for creativity and coherence
59
  response = story_generator(
60
  prompt,
61
+ max_new_tokens=250, # Enough tokens for a complete story
62
  do_sample=True,
63
  temperature=0.7, # Balanced creativity
64
  top_p=0.9, # Focus on more likely tokens for coherence