Spaces:
Sleeping
Sleeping
zerogpu
Browse files- app.py +3 -6
- requirements.txt +2 -1
app.py
CHANGED
@@ -1,12 +1,9 @@
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
from green_score import GREEN
|
|
|
4 |
|
5 |
-
#
|
6 |
-
# -------------------------------------
|
7 |
-
# Paste the GREEN class code above this line
|
8 |
-
# -------------------------------------
|
9 |
-
|
10 |
def run_green(ref_text, hyp_text, model_name="StanfordAIMI/GREEN-radllama2-7b"):
|
11 |
refs = [ref_text.strip()]
|
12 |
hyps = [hyp_text.strip()]
|
@@ -54,7 +51,7 @@ with gr.Blocks(title="GREEN Score Evaluation Demo") as demo:
|
|
54 |
choice = gr.Radio(
|
55 |
label="Choose Input Type",
|
56 |
choices=["Custom"] + list(examples.keys()),
|
57 |
-
value="
|
58 |
interactive=True
|
59 |
)
|
60 |
|
|
|
1 |
import gradio as gr
|
2 |
import pandas as pd
|
3 |
from green_score import GREEN
|
4 |
+
import spaces
|
5 |
|
6 |
+
@spaces.GPU # Add the GPU decorator for functions that need GPU access
|
|
|
|
|
|
|
|
|
7 |
def run_green(ref_text, hyp_text, model_name="StanfordAIMI/GREEN-radllama2-7b"):
|
8 |
refs = [ref_text.strip()]
|
9 |
hyps = [hyp_text.strip()]
|
|
|
51 |
choice = gr.Radio(
|
52 |
label="Choose Input Type",
|
53 |
choices=["Custom"] + list(examples.keys()),
|
54 |
+
value="Custom",
|
55 |
interactive=True
|
56 |
)
|
57 |
|
requirements.txt
CHANGED
@@ -1 +1,2 @@
|
|
1 |
-
green_score
|
|
|
|
1 |
+
green_score
|
2 |
+
spaces
|