Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -2,13 +2,11 @@ import gradio as gr
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import time
|
4 |
|
5 |
-
# Clientes
|
6 |
chat_client = InferenceClient("lambdaindie/lambdai")
|
7 |
image_client = InferenceClient("stabilityai/stable-diffusion-2")
|
8 |
|
9 |
-
#
|
10 |
-
gr.themes.Base().set(font=["JetBrains Mono", "monospace"])
|
11 |
-
|
12 |
css = """
|
13 |
body {
|
14 |
font-family: 'JetBrains Mono', monospace;
|
@@ -36,7 +34,6 @@ body {
|
|
36 |
}
|
37 |
"""
|
38 |
|
39 |
-
# Fun莽茫o do chatbot com racioc铆nio
|
40 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
41 |
messages = [{"role": "system", "content": system_message}] if system_message else []
|
42 |
|
@@ -84,12 +81,11 @@ def respond(message, history, system_message, max_tokens, temperature, top_p):
|
|
84 |
final_answer += token
|
85 |
yield final_answer.strip()
|
86 |
|
87 |
-
# Fun莽茫o para gerar imagem
|
88 |
def generate_image(prompt):
|
89 |
return image_client.text_to_image(prompt, guidance_scale=7.5)
|
90 |
|
91 |
-
# Interface
|
92 |
-
with gr.Blocks(css=css
|
93 |
gr.Markdown("# 位mabdAI")
|
94 |
|
95 |
with gr.Tabs():
|
|
|
2 |
from huggingface_hub import InferenceClient
|
3 |
import time
|
4 |
|
5 |
+
# Clientes
|
6 |
chat_client = InferenceClient("lambdaindie/lambdai")
|
7 |
image_client = InferenceClient("stabilityai/stable-diffusion-2")
|
8 |
|
9 |
+
# CSS com JetBrains Mono for莽ado
|
|
|
|
|
10 |
css = """
|
11 |
body {
|
12 |
font-family: 'JetBrains Mono', monospace;
|
|
|
34 |
}
|
35 |
"""
|
36 |
|
|
|
37 |
def respond(message, history, system_message, max_tokens, temperature, top_p):
|
38 |
messages = [{"role": "system", "content": system_message}] if system_message else []
|
39 |
|
|
|
81 |
final_answer += token
|
82 |
yield final_answer.strip()
|
83 |
|
|
|
84 |
def generate_image(prompt):
|
85 |
return image_client.text_to_image(prompt, guidance_scale=7.5)
|
86 |
|
87 |
+
# Interface
|
88 |
+
with gr.Blocks(css=css) as demo:
|
89 |
gr.Markdown("# 位mabdAI")
|
90 |
|
91 |
with gr.Tabs():
|