Spaces:
Sleeping
Sleeping
expanded readme portion in the markdown.
Browse files- ShaderEval.py +1 -0
- app.py +20 -3
ShaderEval.py
CHANGED
@@ -201,6 +201,7 @@ class Suite(evaluate.EvaluationSuite):
|
|
201 |
args_for_task["split"] = (task.split + f"[:{snippet}]") #make a downselection of the split via keywordarg in the .run() call?
|
202 |
results = task_evaluator.compute(**args_for_task)
|
203 |
|
|
|
204 |
results["task_name"] = task_name + "/" + task.subset if task.subset else task_name
|
205 |
results["data_preprocessor"] = str(task.data_preprocessor) if task.data_preprocessor is not None else None
|
206 |
results_all.append(results)
|
|
|
201 |
args_for_task["split"] = (task.split + f"[:{snippet}]") #make a downselection of the split via keywordarg in the .run() call?
|
202 |
results = task_evaluator.compute(**args_for_task)
|
203 |
|
204 |
+
results["model_cp"] = model_or_pipeline #added this to the output, should be useful. But be careful when passed something that is not a string. #TODO: currently the same for all tasks, maybe move to the list?
|
205 |
results["task_name"] = task_name + "/" + task.subset if task.subset else task_name
|
206 |
results["data_preprocessor"] = str(task.data_preprocessor) if task.data_preprocessor is not None else None
|
207 |
results_all.append(results)
|
app.py
CHANGED
@@ -10,13 +10,23 @@ suite = evaluate.EvaluationSuite.load("Vipitis/ShaderEval") #downloads it
|
|
10 |
def run_suite(model_cp, snippet):
|
11 |
# print(model_cp, snippet)
|
12 |
results = suite.run(model_cp, snippet)
|
13 |
-
return results[0]
|
14 |
|
15 |
with gr.Blocks() as site:
|
16 |
text = gr.Markdown("""# Welcome to the ShaderEval Suite.
|
17 |
|
18 |
This space hosts the ShaderEval Suite. more to follow soon.
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
## Instructions
|
21 |
### Run the code yourself:.
|
22 |
```python
|
@@ -31,9 +41,16 @@ with gr.Blocks() as site:
|
|
31 |
- Select how many **samples** to run (there us up to 100 from the test set)
|
32 |
- Click **Run** to run the suite
|
33 |
- The results will be displayed in the **Output** box
|
34 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
35 |
model_cp = gr.Textbox(value="gpt2", label="Model Checkpoint", interactive=True)
|
36 |
-
first_n = gr.Slider(minimum=1, maximum=100, default=
|
37 |
output = gr.Textbox(label="Output")
|
38 |
run_button = gr.Button(label="Run")
|
39 |
run_button.click(fn=run_suite, inputs=[model_cp, first_n], outputs=output)
|
|
|
10 |
def run_suite(model_cp, snippet):
|
11 |
# print(model_cp, snippet)
|
12 |
results = suite.run(model_cp, snippet)
|
13 |
+
return results[0]
|
14 |
|
15 |
with gr.Blocks() as site:
|
16 |
text = gr.Markdown("""# Welcome to the ShaderEval Suite.
|
17 |
|
18 |
This space hosts the ShaderEval Suite. more to follow soon.
|
19 |
|
20 |
+
# Task1: Return Completion
|
21 |
+
## Explanation
|
22 |
+
Modelled after the [CodeXGLUE code_completion_line](https://huggingface.co/datasets/code_x_glue_cc_code_completion_line) task.
|
23 |
+
Using the "return_completion" subset of the [Shadertoys-fine dataset](https://huggingface.co/datasets/Vipits/Shadertoys-fine).
|
24 |
+
All preprocessing and post proessing is done by the custom evaluator for this suite. It should be as easy as just giving it a model checkpoint that can do the "text-generation" task.
|
25 |
+
Evaluated is currently with just [exact_match](https://huggingface.co/metrics/exact_match).
|
26 |
+
|
27 |
+
## Notice
|
28 |
+
should you find any model that throws an error, please let me know in the issues tab. Several parts of this suite are still missing.
|
29 |
+
|
30 |
## Instructions
|
31 |
### Run the code yourself:.
|
32 |
```python
|
|
|
41 |
- Select how many **samples** to run (there us up to 100 from the test set)
|
42 |
- Click **Run** to run the suite
|
43 |
- The results will be displayed in the **Output** box
|
44 |
+
|
45 |
+
## Todo (feel free to contribute in a Pull Request)
|
46 |
+
- leaderboard
|
47 |
+
- supporting batches to speed up inference
|
48 |
+
- CER metric
|
49 |
+
- removing the pad_token warning
|
50 |
+
"""
|
51 |
+
)
|
52 |
model_cp = gr.Textbox(value="gpt2", label="Model Checkpoint", interactive=True)
|
53 |
+
first_n = gr.Slider(minimum=1, maximum=100, default=15, label="num_samples", step=1.0)
|
54 |
output = gr.Textbox(label="Output")
|
55 |
run_button = gr.Button(label="Run")
|
56 |
run_button.click(fn=run_suite, inputs=[model_cp, first_n], outputs=output)
|