John Graham Reynolds
commited on
Commit
·
b71d998
1
Parent(s):
7e739b5
first addition of app for testing
Browse files
app.py
ADDED
@@ -0,0 +1,32 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
from fixed_f1 import FixedF1
|
2 |
+
from fixed_precision import FixedPrecision
|
3 |
+
from fixed_recall import FixedRecall
|
4 |
+
|
5 |
+
import gradio as gr
|
6 |
+
|
7 |
+
title = "🤗 Evaluate Fix!"
|
8 |
+
|
9 |
+
description = """
|
10 |
+
This space is designed to show off a workaround for a current bug in the 🤗 Evaluate library as we introduce ourselves to the entirety of the 🤗 ecosystem.
|
11 |
+
"""
|
12 |
+
|
13 |
+
article = "Check out [original repo](https://huggingface.co/spaces/kingabzpro/Rick_and_Morty_Bot) housing this code, and a quickly trained [multilabel text \
|
14 |
+
classicifcation model](https://github.com/johngrahamreynolds/RoBERTa-base-DReiFT/tree/main) that makes use of it during evaluation."
|
15 |
+
|
16 |
+
def show_off(input):
|
17 |
+
f1 = FixedF1()
|
18 |
+
precision = FixedPrecision()
|
19 |
+
recall = FixedRecall()
|
20 |
+
|
21 |
+
return "Checking this out! Here's what you put in: " + f"""{input} """
|
22 |
+
|
23 |
+
|
24 |
+
gr.Interface(
|
25 |
+
fn=show_off,
|
26 |
+
inputs="textbox",
|
27 |
+
outputs="text",
|
28 |
+
title=title,
|
29 |
+
description=description,
|
30 |
+
article=article,
|
31 |
+
examples=[["What are you doing?"], ["Where should we time travel to?"]],
|
32 |
+
).launch()
|