Spaces:
Sleeping
Sleeping
gabehubner
commited on
Commit
·
d116e72
1
Parent(s):
ee1c253
testing gradio
Browse files- app.py +24 -0
- requirements.txt +0 -1
app.py
CHANGED
@@ -1,3 +1,27 @@
|
|
1 |
import gradio as gr
|
2 |
from train import TrainingLoop
|
3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
from train import TrainingLoop
|
3 |
|
4 |
+
|
5 |
+
|
6 |
+
def image_classifier(inp):
|
7 |
+
return {'cat': 0.3, 'dog': 0.7}
|
8 |
+
|
9 |
+
|
10 |
+
|
11 |
+
|
12 |
+
|
13 |
+
iface = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
14 |
+
|
15 |
+
|
16 |
+
|
17 |
+
|
18 |
+
load_trained = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
19 |
+
|
20 |
+
|
21 |
+
|
22 |
+
|
23 |
+
attribute = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
24 |
+
|
25 |
+
|
26 |
+
# iface = gr.TabbedInterface(interface_list=[train_from_scratch, load_trained, attribute], tab_names=["Train from Scratch", "Continue Training", "Attribute"],title="Attribution in Deep Reinforcement Learning")
|
27 |
+
iface.launch()
|
requirements.txt
CHANGED
@@ -355,7 +355,6 @@ tokenize-rt==5.2.0
|
|
355 |
tomlkit==0.12.0
|
356 |
toolz==0.12.0
|
357 |
torch==2.1.0
|
358 |
-
torchrl @ git+https://github.com/pytorch/rl.git@bf264e0e24971fc05ec42b571de7b8df84043a51
|
359 |
torchsnapshot==0.1.0
|
360 |
torchvision==0.16.0
|
361 |
tornado==6.3.3
|
|
|
355 |
tomlkit==0.12.0
|
356 |
toolz==0.12.0
|
357 |
torch==2.1.0
|
|
|
358 |
torchsnapshot==0.1.0
|
359 |
torchvision==0.16.0
|
360 |
tornado==6.3.3
|