Update main.py
Browse files
main.py
CHANGED
|
@@ -80,7 +80,7 @@ import random
|
|
| 80 |
from fastapi import BackgroundTasks
|
| 81 |
|
| 82 |
@app.post("/generate-story/")
|
| 83 |
-
async def generate_story(image_file: UploadFile = File(...),
|
| 84 |
image_data = await image_file.read()
|
| 85 |
system_prompt = f"write an attractive story in 300 words about {random.choice(['an adventurous journey', 'a mysterious encounter', 'a heroic quest'])}"
|
| 86 |
caption = generate_image_caption(image_data)
|
|
|
|
| 80 |
from fastapi import BackgroundTasks
|
| 81 |
|
| 82 |
@app.post("/generate-story/")
|
| 83 |
+
async def generate_story(image_file: UploadFile = File(...), target_language: str = Form(...), background_tasks: BackgroundTasks = BackgroundTasks()):
|
| 84 |
image_data = await image_file.read()
|
| 85 |
system_prompt = f"write an attractive story in 300 words about {random.choice(['an adventurous journey', 'a mysterious encounter', 'a heroic quest'])}"
|
| 86 |
caption = generate_image_caption(image_data)
|