Update app.py
Browse files
app.py
CHANGED
@@ -1,4 +1,5 @@
|
|
1 |
# Imports
|
|
|
2 |
import os
|
3 |
import streamlit as st
|
4 |
import requests
|
@@ -79,6 +80,7 @@ def main():
|
|
79 |
st.image(uploaded_file, caption='🖼️ Uploaded Image', use_column_width=True)
|
80 |
|
81 |
# Initiates AI processing and story generation
|
|
|
82 |
with st.spinner("## 🤖 AI is at Work! "):
|
83 |
scenario = img2txt("uploaded_image.jpg") # Extracts text from the image
|
84 |
story = txt2story(scenario, top_k, top_p, temperature) # Generates a story based on the image text, LLM params
|
|
|
1 |
# Imports
|
2 |
+
import spaces
|
3 |
import os
|
4 |
import streamlit as st
|
5 |
import requests
|
|
|
80 |
st.image(uploaded_file, caption='🖼️ Uploaded Image', use_column_width=True)
|
81 |
|
82 |
# Initiates AI processing and story generation
|
83 |
+
@spaces.GPU
|
84 |
with st.spinner("## 🤖 AI is at Work! "):
|
85 |
scenario = img2txt("uploaded_image.jpg") # Extracts text from the image
|
86 |
story = txt2story(scenario, top_k, top_p, temperature) # Generates a story based on the image text, LLM params
|