MrAli813 commited on
Commit
b2a8fde
·
1 Parent(s): 1d40c09

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -1,6 +1,25 @@
 
 
1
  import openai
2
  import gradio as gr
3
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
4
  openai.api_key = "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"
5
 
6
  def predict(message, history):
@@ -37,5 +56,5 @@ A2 = gr.load(
37
 
38
  A3 = gr.load("huggingface/google/vit-base-patch16-224")
39
 
40
- pcp = gr.TabbedInterface([A1, A2], ["Chat", "Vision"], theme= gr.themes.Glass(primary_hue="amber", neutral_hue="lime"))
41
  pcp.queue().launch()
 
1
+ import os
2
+ import io
3
  import openai
4
  import gradio as gr
5
 
6
+ import IPython.display
7
+ from PIL import Image
8
+
9
+ import base64
10
+ from dotenv import load_dotenv, find_dotenv
11
+ _ = load_dotenv(find_dotenv()) # read local .env file
12
+ hf_api_key ='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'
13
+
14
+ import requests
15
+
16
+ def query(payload):
17
+ response = requests.post(API_URL, headers=headers, json=payload)
18
+ return response.content
19
+
20
+ # Helper function
21
+ import requests, json
22
+
23
  openai.api_key = "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"
24
 
25
  def predict(message, history):
 
56
 
57
  A3 = gr.load("huggingface/google/vit-base-patch16-224")
58
 
59
+ pcp = gr.TabbedInterface([A1, A2], ["Chat", "Describe", "Create"], theme= gr.themes.Glass(primary_hue="amber", neutral_hue="lime"))
60
  pcp.queue().launch()