autonomous019 commited on
Commit
758e1e6
1 Parent(s): c7d234c

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -1
app.py CHANGED
@@ -24,6 +24,11 @@ from spaces_info import description, examples, initial_prompt_value
24
  API_URL = os.getenv("API_URL")
25
  HF_API_TOKEN = os.getenv("HF_API_TOKEN")
26
 
 
 
 
 
 
27
  print(API_URL)
28
  print(HF_API_TOKEN)
29
 
@@ -196,7 +201,8 @@ def classify_image(image):
196
 
197
  image = gr.inputs.Image(type="pil")
198
  label = gr.outputs.Label(num_top_classes=5)
199
- examples = [ ["cats.jpg"], ["batter.jpg"],["drinkers.jpg"] ]
 
200
  title = "Generate a Story from an Image"
201
  description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit', a story is autogenerated as well"
202
  article = "<p style='text-align: center'></p>"
 
24
  API_URL = os.getenv("API_URL")
25
  HF_API_TOKEN = os.getenv("HF_API_TOKEN")
26
 
27
+ ##Bloom Inference API
28
+ API_URL = "https://api-inference.huggingface.co/models/bigscience/bloom"
29
+ HF_TOKEN = os.environ["HF_TOKEN"]
30
+ headers = {"Authorization": f"Bearer {HF_TOKEN}"}
31
+
32
  print(API_URL)
33
  print(HF_API_TOKEN)
34
 
 
201
 
202
  image = gr.inputs.Image(type="pil")
203
  label = gr.outputs.Label(num_top_classes=5)
204
+ #examples = [ ["cats.jpg"], ["batter.jpg"],["drinkers.jpg"] ]
205
+ examples = [ ["batter.jpg"] ]
206
  title = "Generate a Story from an Image"
207
  description = "Demo for classifying images with Perceiver IO. To use it, simply upload an image and click 'submit', a story is autogenerated as well"
208
  article = "<p style='text-align: center'></p>"