Spaces:
Sleeping
Sleeping
Commit ·
6704664
1
Parent(s): dd4e14e
requirements 3.10
Browse files- app.py +2 -4
- prompt_bot.py +3 -0
- util/extract_data.py +2 -1
app.py
CHANGED
|
@@ -1,5 +1,3 @@
|
|
| 1 |
-
import os
|
| 2 |
-
from datetime import datetime
|
| 3 |
from typing import List, Optional
|
| 4 |
|
| 5 |
import gradio as gr
|
|
@@ -10,7 +8,7 @@ from huggingface_hub import InferenceClient
|
|
| 10 |
from prompt_bot import prompt_for_template, template_bot
|
| 11 |
from util.extract_data import extrair_dados_template
|
| 12 |
from util.import_dataset import get_response_from_huggingface_dataset
|
| 13 |
-
|
| 14 |
|
| 15 |
|
| 16 |
descricao, regras, comportamento = extrair_dados_template()
|
|
@@ -21,6 +19,7 @@ MODEL: str = "meta-llama/Llama-3.2-3B-Instruct"
|
|
| 21 |
TEMPLATE_BOT = template_bot()
|
| 22 |
prompt_template = prompt_for_template(TEMPLATE_BOT)
|
| 23 |
|
|
|
|
| 24 |
DATASET = load_dataset("wendellast/GUI-Ban")
|
| 25 |
|
| 26 |
client: InferenceClient = InferenceClient(model=MODEL)
|
|
@@ -64,7 +63,6 @@ def respond(
|
|
| 64 |
yield response
|
| 65 |
|
| 66 |
|
| 67 |
-
# Adicione type="messages" para evitar o aviso
|
| 68 |
demo: gr.ChatInterface = gr.ChatInterface(
|
| 69 |
respond,
|
| 70 |
additional_inputs=[
|
|
|
|
|
|
|
|
|
|
| 1 |
from typing import List, Optional
|
| 2 |
|
| 3 |
import gradio as gr
|
|
|
|
| 8 |
from prompt_bot import prompt_for_template, template_bot
|
| 9 |
from util.extract_data import extrair_dados_template
|
| 10 |
from util.import_dataset import get_response_from_huggingface_dataset
|
| 11 |
+
|
| 12 |
|
| 13 |
|
| 14 |
descricao, regras, comportamento = extrair_dados_template()
|
|
|
|
| 19 |
TEMPLATE_BOT = template_bot()
|
| 20 |
prompt_template = prompt_for_template(TEMPLATE_BOT)
|
| 21 |
|
| 22 |
+
#modify future
|
| 23 |
DATASET = load_dataset("wendellast/GUI-Ban")
|
| 24 |
|
| 25 |
client: InferenceClient = InferenceClient(model=MODEL)
|
|
|
|
| 63 |
yield response
|
| 64 |
|
| 65 |
|
|
|
|
| 66 |
demo: gr.ChatInterface = gr.ChatInterface(
|
| 67 |
respond,
|
| 68 |
additional_inputs=[
|
prompt_bot.py
CHANGED
|
@@ -15,6 +15,9 @@ def template_bot() -> str:
|
|
| 15 |
|
| 16 |
|
| 17 |
Usuário: {mensagem}
|
|
|
|
|
|
|
|
|
|
| 18 |
IA-BOT:
|
| 19 |
"""
|
| 20 |
return template
|
|
|
|
| 15 |
|
| 16 |
|
| 17 |
Usuário: {mensagem}
|
| 18 |
+
|
| 19 |
+
Escreva a messagem do commit de forma simples, e o mais curto possivel apenas palavras chaves
|
| 20 |
+
|
| 21 |
IA-BOT:
|
| 22 |
"""
|
| 23 |
return template
|
util/extract_data.py
CHANGED
|
@@ -41,9 +41,10 @@ def extrair_dados_template(template: dict=data):
|
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
-
|
| 45 |
descricao, regra, compoa = extrair_dados_template()
|
| 46 |
print(descricao)
|
| 47 |
print(regra)
|
| 48 |
print(compoa)
|
|
|
|
| 49 |
|
|
|
|
| 41 |
|
| 42 |
|
| 43 |
|
| 44 |
+
"""
|
| 45 |
descricao, regra, compoa = extrair_dados_template()
|
| 46 |
print(descricao)
|
| 47 |
print(regra)
|
| 48 |
print(compoa)
|
| 49 |
+
"""
|
| 50 |
|