Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -1,35 +1,15 @@
|
|
1 |
-
import google.generativeai as genai
|
2 |
import gradio as gr
|
3 |
-
import
|
4 |
-
import
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
else:
|
18 |
-
img = PIL.Image.open(image)
|
19 |
-
|
20 |
-
response = model.generate_content(["write a short story about the image", img])
|
21 |
-
|
22 |
-
return response.text
|
23 |
-
|
24 |
-
|
25 |
-
app = gr.Interface(ImageChat,
|
26 |
-
inputs = gr.Image(label = "Image"),
|
27 |
-
outputs = gr.Text(label = "Story"),
|
28 |
-
examples = ["rubiks cube.jpg","giraffe.jpg","street.jpg"],
|
29 |
-
title = "Image-To-Story",
|
30 |
-
theme = "patrickosornio/my_theme1")
|
31 |
-
|
32 |
-
|
33 |
-
app.launch()
|
34 |
-
|
35 |
-
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import groq_gradio
|
3 |
+
import os
|
4 |
+
|
5 |
+
os.environ["GROQ_API_KEY"] = "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"
|
6 |
+
gr.load(
|
7 |
+
name = "llama-3.2-3b-preview",
|
8 |
+
src = groq_gradio.registry,
|
9 |
+
title = "Groq-Gradio Chat",
|
10 |
+
theme = "ParityError/LimeFace",
|
11 |
+
examples = ["Tell me a short story about a puppy",
|
12 |
+
"Write a 14 line poem about travelling in Shakespeare style",
|
13 |
+
"What are the wonders of the world?",
|
14 |
+
"List the countries in Africa and their capitals"]
|
15 |
+
).launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|