Update app.py
Browse files
app.py
CHANGED
@@ -18,7 +18,6 @@ def img2txt(url):
|
|
18 |
text = captioning_model(url, max_new_tokens=20)[0]["generated_text"]
|
19 |
|
20 |
print(text)
|
21 |
-
print("Text generated successfully.")
|
22 |
return text
|
23 |
|
24 |
# Text-to-story
|
@@ -35,7 +34,7 @@ def txt2story(img_text):
|
|
35 |
Resolve the conflict or summarize the outcome of the situation. Ensure the story MUST
|
36 |
have a definitive ending. The end.'''
|
37 |
|
38 |
-
|
39 |
messages = [
|
40 |
{"role": "system", "content": '''You are an expert short story writer who specialises
|
41 |
in writing stories on input set of words.''', "temperature": 0.8},
|
@@ -48,7 +47,6 @@ def txt2story(img_text):
|
|
48 |
model="mistralai/Mixtral-8x7B-Instruct-v0.1",
|
49 |
max_tokens=200)
|
50 |
|
51 |
-
print("Story generated successfully.")
|
52 |
return chat_completion.choices[0].message.content
|
53 |
print(chat_completion.choices[0].message.content)
|
54 |
|
|
|
18 |
text = captioning_model(url, max_new_tokens=20)[0]["generated_text"]
|
19 |
|
20 |
print(text)
|
|
|
21 |
return text
|
22 |
|
23 |
# Text-to-story
|
|
|
34 |
Resolve the conflict or summarize the outcome of the situation. Ensure the story MUST
|
35 |
have a definitive ending. The end.'''
|
36 |
|
37 |
+
|
38 |
messages = [
|
39 |
{"role": "system", "content": '''You are an expert short story writer who specialises
|
40 |
in writing stories on input set of words.''', "temperature": 0.8},
|
|
|
47 |
model="mistralai/Mixtral-8x7B-Instruct-v0.1",
|
48 |
max_tokens=200)
|
49 |
|
|
|
50 |
return chat_completion.choices[0].message.content
|
51 |
print(chat_completion.choices[0].message.content)
|
52 |
|