Spaces:
Runtime error
Runtime error
Commit
·
203866a
1
Parent(s):
161b7ff
Debugged app.py
Browse files
app.py
CHANGED
@@ -1,23 +1,5 @@
|
|
1 |
-
"""from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
-
|
4 |
-
learn = load_learner('tokenizer.model')
|
5 |
-
|
6 |
-
categories = ('Rasam', 'Sambar')
|
7 |
-
|
8 |
-
def classify_image(img):
|
9 |
-
pred, idx, probs = learn.predict(img)
|
10 |
-
return dict(zip(categories, map(float, probs)))
|
11 |
-
|
12 |
-
image = gr.inputs.Image(shape=(192, 192))
|
13 |
-
label = gr.outputs.Label()
|
14 |
-
examples = ['sambar.jpg', 'rasam.jpg']
|
15 |
-
|
16 |
-
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
17 |
-
intf.launch()"""
|
18 |
-
|
19 |
-
import gradio as gr
|
20 |
-
"""import transformers
|
21 |
from transformers import AutoTokenizer
|
22 |
import torch
|
23 |
from diffusers.utils.torch_utils import randn_tensor
|
@@ -49,17 +31,4 @@ def debate_response(text):
|
|
49 |
return resposnse
|
50 |
|
51 |
intf = gr.Interface(fn=debate_response, inputs=gr.Textbox(), outputs="text")
|
52 |
-
intf.launch()
|
53 |
-
|
54 |
-
# import gradio as gr
|
55 |
-
|
56 |
-
def greet(name):
|
57 |
-
return "Hello " + name + "!"
|
58 |
-
|
59 |
-
demo = gr.Interface(
|
60 |
-
fn=greet,
|
61 |
-
inputs=gr.Textbox(lines=2, placeholder="Name Here..."),
|
62 |
-
outputs="text",
|
63 |
-
)
|
64 |
-
if __name__ == "__main__":
|
65 |
-
demo.launch()
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
import transformers
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
3 |
from transformers import AutoTokenizer
|
4 |
import torch
|
5 |
from diffusers.utils.torch_utils import randn_tensor
|
|
|
31 |
return resposnse
|
32 |
|
33 |
intf = gr.Interface(fn=debate_response, inputs=gr.Textbox(), outputs="text")
|
34 |
+
intf.launch()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|