Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
import streamlit as st
|
2 |
-
from transformers import pipeline
|
3 |
-
|
4 |
# function part
|
5 |
# img2text
|
6 |
def img2text(url):
|
@@ -10,7 +10,7 @@ def img2text(url):
|
|
10 |
|
11 |
# text2story
|
12 |
def text2story(text):
|
13 |
-
text_to_story = pipeline("text-generation", model="
|
14 |
# story_text = "" # to be completed
|
15 |
story_text = text_to_story(text)[0]["generated_text"]
|
16 |
return story_text
|
|
|
1 |
import streamlit as st
|
2 |
+
from transformers import pipeline
|
3 |
+
|
4 |
# function part
|
5 |
# img2text
|
6 |
def img2text(url):
|
|
|
10 |
|
11 |
# text2story
|
12 |
def text2story(text):
|
13 |
+
text_to_story = pipeline("text-generation", model="ajibawa-2023/Young-Children-Storyteller-Mistral-7B")
|
14 |
# story_text = "" # to be completed
|
15 |
story_text = text_to_story(text)[0]["generated_text"]
|
16 |
return story_text
|