Spaces:
Sleeping
Sleeping
petergits commited on
Commit ·
c628515
1
Parent(s): 13b8710
Initial commit
Browse files- .gitignore +2 -0
- app.py +7 -0
- requirements.txt +10 -0
- testClient.py +8 -0
.gitignore
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#Virtual Environments
|
| 2 |
+
venv
|
app.py
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def greet(name):
|
| 4 |
+
return "Hello " + name + "!!"
|
| 5 |
+
|
| 6 |
+
demo = gr.Interface(fn=greet, inputs="text", outputs="text")
|
| 7 |
+
demo.launch(mcp_server=True)
|
requirements.txt
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
transformers
|
| 2 |
+
gradio[mcp]
|
| 3 |
+
torch
|
| 4 |
+
requests
|
| 5 |
+
Pillow
|
| 6 |
+
open_clip_torch
|
| 7 |
+
ftfy
|
| 8 |
+
|
| 9 |
+
# This is only needed for local deployment
|
| 10 |
+
gradio
|
testClient.py
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from gradio_client import Client
|
| 2 |
+
|
| 3 |
+
client = Client("http://127.0.0.1:7860/")
|
| 4 |
+
result = client.predict(
|
| 5 |
+
name="Hello!!",
|
| 6 |
+
api_name="/predict"
|
| 7 |
+
)
|
| 8 |
+
print(result)
|