Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,14 @@ from huggingface_hub import InferenceClient
|
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
| 6 |
import os
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
|
| 8 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 9 |
knowledge_base = file.read()
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
| 6 |
import os
|
| 7 |
+
import gradio as gr
|
| 8 |
+
|
| 9 |
+
def image_classifier(inp):
|
| 10 |
+
return {'cat': 0.3, 'dog': 0.7}
|
| 11 |
+
|
| 12 |
+
demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label")
|
| 13 |
+
demo.launch()
|
| 14 |
+
|
| 15 |
|
| 16 |
with open("knowledge.txt", "r", encoding="utf-8") as file:
|
| 17 |
knowledge_base = file.read()
|