Spaces:
Sleeping
Sleeping
First version
Browse files
README.md
CHANGED
|
@@ -3,11 +3,14 @@ title: Mytest
|
|
| 3 |
emoji: ⚡
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: pink
|
|
|
|
| 6 |
sdk: gradio
|
| 7 |
sdk_version: 4.44.0
|
| 8 |
app_file: app.py
|
| 9 |
pinned: false
|
| 10 |
license: mit
|
|
|
|
|
|
|
| 11 |
---
|
| 12 |
|
| 13 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
|
|
|
| 3 |
emoji: ⚡
|
| 4 |
colorFrom: purple
|
| 5 |
colorTo: pink
|
| 6 |
+
python_version: 3.12
|
| 7 |
sdk: gradio
|
| 8 |
sdk_version: 4.44.0
|
| 9 |
app_file: app.py
|
| 10 |
pinned: false
|
| 11 |
license: mit
|
| 12 |
+
short_description: A short description of the Space
|
| 13 |
+
tags: ['rediction', 'ehr', 'graph-neural-network']
|
| 14 |
---
|
| 15 |
|
| 16 |
Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference
|
app.py
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from typing import Dict
|
| 2 |
+
|
| 3 |
+
import gradio as gr
|
| 4 |
+
|
| 5 |
+
|
| 6 |
+
def predict(text: str) -> Dict:
|
| 7 |
+
return {"alive": 0.9, "death": 0.1}
|
| 8 |
+
|
| 9 |
+
|
| 10 |
+
example_list = [[1.0, 1.0, 0.0], [1.0, 0.0, 0.0], [0.0, 0.0, 0.0]]
|
| 11 |
+
|
| 12 |
+
# Create title, description and article strings
|
| 13 |
+
title = "This is title."
|
| 14 |
+
description = "This is description."
|
| 15 |
+
article = "This is article."
|
| 16 |
+
|
| 17 |
+
demo = gr.Interface(fn=predict,
|
| 18 |
+
inputs="text",
|
| 19 |
+
outputs=gr.Label(num_top_classes=2, label="Predictions"),
|
| 20 |
+
examples=example_list,
|
| 21 |
+
title=title,
|
| 22 |
+
description=description,
|
| 23 |
+
article=article)
|
| 24 |
+
|
| 25 |
+
demo.launch(debug=False,
|
| 26 |
+
share=True)
|