Spaces:
Build error
Build error
Update app.py
Browse files11 unmodified lines1213141516171839 unmodified lines5859606162636411 unmodified lines"""Load all models and cache them for faster execution"""models = {"image_captioner": pipeline("image-to-text", model="sooh-j/blip-image-captioning-base"),"story_generator": pipeline("text-generation", model="TinyLlama/TinyLlama-1.1B-Chat-v1.0")}return models39 unmodified lines# Generate story with parameters tuned for brevity and coherenceresponse = story_generator(prompt,max_new_tokens=100, # Allow enough tokens for a complete storydo_sample=True,temperature=0.7, # Balanced creativitytop_p=0.9, # Focus on more likely tokens11 unmodified lines1213141516171839 unmodified lines5859606162636411 unmodified lines"""Load all models and cache them for faster execution"""models = {"image_captioner": pipeline("image-to-text", model="sooh-j/blip-image-captioning-base"),"story_generator": pipeline("text-generation", model="deepseek-ai/DeepSeek-R1")}return models39 unmodified lines# Generate story with parameters tuned for brevity and coherenceresponse = story_generator(prompt,max_new_tokens=120, # Allow enough tokens for a complete storydo_sample=True,temperature=0.7, # Balanced creativitytop_p=0.9, # Focus on more likely tokens
app.py+2-2