Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
@@ -1,10 +1,27 @@
|
|
1 |
import gradio as gr
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
-
|
4 |
"""
|
5 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
6 |
"""
|
7 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
8 |
|
9 |
|
10 |
def respond(
|
|
|
1 |
import gradio as gr
|
2 |
+
import google.generativeai as genai
|
3 |
from huggingface_hub import InferenceClient
|
4 |
+
import gradio as gr
|
5 |
"""
|
6 |
For more information on `huggingface_hub` Inference API support, please check the docs: https://huggingface.co/docs/huggingface_hub/v0.22.2/en/guides/inference
|
7 |
"""
|
8 |
client = InferenceClient("HuggingFaceH4/zephyr-7b-beta")
|
9 |
+
genai.configure(api_key=os.environ["GEMINI_API_KEY"])
|
10 |
+
|
11 |
+
generation_config = {
|
12 |
+
"temperature": 0.7,
|
13 |
+
"top_p": 0.95,
|
14 |
+
"top_k": 64,
|
15 |
+
"max_output_tokens": 128,
|
16 |
+
"response_mime_type": "text/plain",
|
17 |
+
}
|
18 |
+
|
19 |
+
model = genai.GenerativeModel(
|
20 |
+
model_name="gemini-1.5-flash",
|
21 |
+
generation_config=generation_config,
|
22 |
+
# safety_settings = Adjust safety settings
|
23 |
+
# See https://ai.google.dev/gemini-api/docs/safety-settings
|
24 |
+
)
|
25 |
|
26 |
|
27 |
def respond(
|