Spaces:
Running
Running
Commit
·
9405ec1
1
Parent(s):
59f483d
lets gui
Browse files- app.py +25 -7
- data/config.json +28 -0
app.py
CHANGED
@@ -1,10 +1,31 @@
|
|
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(
|
@@ -40,13 +61,10 @@ def respond(
|
|
40 |
yield response
|
41 |
|
42 |
|
43 |
-
"""
|
44 |
-
For information on how to customize the ChatInterface, peruse the gradio docs: https://www.gradio.app/docs/chatinterface
|
45 |
-
"""
|
46 |
demo = gr.ChatInterface(
|
47 |
respond,
|
48 |
additional_inputs=[
|
49 |
-
gr.Textbox(value=
|
50 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
51 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
52 |
gr.Slider(
|
|
|
1 |
import gradio as gr
|
2 |
+
import json
|
3 |
+
|
4 |
+
|
5 |
+
from datetime import datetime
|
6 |
+
|
7 |
from huggingface_hub import InferenceClient
|
8 |
|
9 |
+
|
10 |
+
|
11 |
+
now = datetime.now()
|
12 |
+
|
13 |
+
|
14 |
+
|
15 |
+
with open("data/config.json", "r", encoding="UTF-8") as file:
|
16 |
+
config = json.load(file)
|
17 |
+
|
18 |
+
client = InferenceClient(
|
19 |
+
model="meta-llama/Llama-3.2-3B-Instruct"
|
20 |
+
)
|
21 |
+
|
22 |
+
|
23 |
+
rules = f"""
|
24 |
+
# INFORMAÇÕES GERAIS: (hoje é {now.strftime("%d/%m/%Y %H:%M:%S")},
|
25 |
+
# VOCÊ FOI CRIADO PELO GRUPO Last, O SEU NOME É 'GUI',
|
26 |
+
# ESTAS SÃO SUAS CONFIGURAÇÕES E REGRAS: {config},
|
27 |
+
# SUAS RESPOSTAS DEVEM SER SARCASTICAMENTE DIVERTIDAS :),
|
28 |
"""
|
|
|
|
|
|
|
29 |
|
30 |
|
31 |
def respond(
|
|
|
61 |
yield response
|
62 |
|
63 |
|
|
|
|
|
|
|
64 |
demo = gr.ChatInterface(
|
65 |
respond,
|
66 |
additional_inputs=[
|
67 |
+
gr.Textbox(value=rules, label="System message"),
|
68 |
gr.Slider(minimum=1, maximum=2048, value=512, step=1, label="Max new tokens"),
|
69 |
gr.Slider(minimum=0.1, maximum=4.0, value=0.7, step=0.1, label="Temperature"),
|
70 |
gr.Slider(
|
data/config.json
ADDED
@@ -0,0 +1,28 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"config": {
|
3 |
+
"name": "Gui",
|
4 |
+
"version": 3.0,
|
5 |
+
"developers LAST": {
|
6 |
+
"wendellast": {
|
7 |
+
"name": "wendellast",
|
8 |
+
"function": "geral devloper",
|
9 |
+
"profile": "https://github.com/wendellast"
|
10 |
+
},
|
11 |
+
"contri": [
|
12 |
+
{
|
13 |
+
"name": "LuyysHenriqueKuromi",
|
14 |
+
"function": "Translate components to English",
|
15 |
+
"profile": "https://github.com/LuyysHenriqueKuromi"
|
16 |
+
},
|
17 |
+
{
|
18 |
+
"name": "Andra-sun",
|
19 |
+
"function": "designer devloper",
|
20 |
+
"profile": "https://github.com/Andra-sun"
|
21 |
+
}
|
22 |
+
]
|
23 |
+
}
|
24 |
+
},
|
25 |
+
"data_created": "31/12/2023",
|
26 |
+
"country":"Brasil",
|
27 |
+
"status": "active"
|
28 |
+
}
|