adi-123 commited on
Commit
0d4817b
·
verified ·
1 Parent(s): 1d5a944

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -0
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