Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -9,13 +9,22 @@ import google.generativeai as genai
|
|
9 |
secret = os.environ["secret"]
|
10 |
genai.configure(api_key=secret)
|
11 |
model = genai.GenerativeModel('gemini-pro-vision')
|
|
|
12 |
|
|
|
|
|
|
|
|
|
|
|
|
|
13 |
|
14 |
|
15 |
with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
|
16 |
with gr.Row():
|
17 |
with gr.Column(scale=1):
|
18 |
image = gr.Image(type="filepath")
|
|
|
|
|
19 |
with gr.Column(scale=6):
|
20 |
chatbot = gr.Chatbot([[None,"Hi there, what brings you here today?"]],avatar_images=("https://cdnl.iconscout.com/lottie/premium/thumb/user-profile-5568736-4644453.gif","https://cdn.dribbble.com/users/77598/screenshots/16399264/media/d86ceb1ad552398787fb76f343080aa6.gif"),height=460,show_label=False,show_copy_button=True,show_share_button=True,likeable=True,layout="panel")
|
21 |
msg = gr.Textbox(show_label=False,placeholder="type anything and press enter")
|
|
|
9 |
secret = os.environ["secret"]
|
10 |
genai.configure(api_key=secret)
|
11 |
model = genai.GenerativeModel('gemini-pro-vision')
|
12 |
+
import pandas as pd
|
13 |
|
14 |
+
df = pd.read_csv("network.csv")
|
15 |
+
|
16 |
+
def upload_file(files):
|
17 |
+
print(file.name)
|
18 |
+
df = pd.read_csv("network.csv")
|
19 |
+
return file.name
|
20 |
|
21 |
|
22 |
with gr.Blocks(theme=gr.themes.Soft(),css=css) as demo:
|
23 |
with gr.Row():
|
24 |
with gr.Column(scale=1):
|
25 |
image = gr.Image(type="filepath")
|
26 |
+
upload_button = gr.UploadButton("Click to Upload a csv File")
|
27 |
+
upload_button.upload(upload_file, upload_button, msg)
|
28 |
with gr.Column(scale=6):
|
29 |
chatbot = gr.Chatbot([[None,"Hi there, what brings you here today?"]],avatar_images=("https://cdnl.iconscout.com/lottie/premium/thumb/user-profile-5568736-4644453.gif","https://cdn.dribbble.com/users/77598/screenshots/16399264/media/d86ceb1ad552398787fb76f343080aa6.gif"),height=460,show_label=False,show_copy_button=True,show_share_button=True,likeable=True,layout="panel")
|
30 |
msg = gr.Textbox(show_label=False,placeholder="type anything and press enter")
|