Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -3,7 +3,7 @@ import torch
|
|
| 3 |
from peft import PeftModel, PeftConfig
|
| 4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 5 |
|
| 6 |
-
peft_model_id = "
|
| 7 |
config = PeftConfig.from_pretrained(peft_model_id)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
|
| 9 |
tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
|
|
@@ -27,10 +27,10 @@ def predecir_intervencion(text):
|
|
| 27 |
with gr.Blocks() as demo:
|
| 28 |
gr.Markdown("Predicci贸n de intervenciones para mitigar el da帽o racista en el pueblo gitano")
|
| 29 |
with gr.Row():
|
| 30 |
-
hechos = gr.Textbox(placeholder="Un alumno gitano de un Instituto...")
|
| 31 |
with gr.Row():
|
| 32 |
-
intervencion = gr.Textbox()
|
| 33 |
-
resultado = gr.Textbox()
|
| 34 |
|
| 35 |
btn = gr.Button("Go")
|
| 36 |
btn.click(fn=predecir_intervencion, inputs=hechos, outputs=[intervencion, resultado])
|
|
|
|
| 3 |
from peft import PeftModel, PeftConfig
|
| 4 |
from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 5 |
|
| 6 |
+
peft_model_id = "hackathon-somos-nlp-2023/discriminacion_gitana_intervenciones_balanceado"
|
| 7 |
config = PeftConfig.from_pretrained(peft_model_id)
|
| 8 |
model = AutoModelForCausalLM.from_pretrained(config.base_model_name_or_path, return_dict=True, load_in_8bit=True, device_map='auto')
|
| 9 |
tokenizer = AutoTokenizer.from_pretrained(peft_model_id)
|
|
|
|
| 27 |
with gr.Blocks() as demo:
|
| 28 |
gr.Markdown("Predicci贸n de intervenciones para mitigar el da帽o racista en el pueblo gitano")
|
| 29 |
with gr.Row():
|
| 30 |
+
hechos = gr.Textbox(placeholder="Un alumno gitano de un Instituto...", label="Hechos")
|
| 31 |
with gr.Row():
|
| 32 |
+
intervencion = gr.Textbox(label="Intervenci贸n")
|
| 33 |
+
resultado = gr.Textbox(label="Resultado")
|
| 34 |
|
| 35 |
btn = gr.Button("Go")
|
| 36 |
btn.click(fn=predecir_intervencion, inputs=hechos, outputs=[intervencion, resultado])
|