Spaces:
Sleeping
Sleeping
added the style fix to the js
Browse files
app.py
CHANGED
|
@@ -1,28 +1,7 @@
|
|
| 1 |
import gradio as gr
|
| 2 |
-
from fastapi import FastAPI, Request
|
| 3 |
-
import json
|
| 4 |
|
| 5 |
-
|
| 6 |
-
|
| 7 |
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
# ✅ JavaScript to Capture and Send MIDI Data
|
| 11 |
-
midi_js = """
|
| 12 |
-
<script>
|
| 13 |
-
|
| 14 |
-
</script>
|
| 15 |
-
"""
|
| 16 |
-
|
| 17 |
-
# ✅ Inject JavaScript and HTML
|
| 18 |
-
with gr.Blocks() as demo:
|
| 19 |
-
gr.HTML(midi_js)
|
| 20 |
-
|
| 21 |
-
# ✅ Mount FastAPI with Gradio
|
| 22 |
-
app = gr.mount_gradio_app(app, demo, path="/")
|
| 23 |
-
|
| 24 |
-
if __name__ == "__main__":
|
| 25 |
-
import uvicorn
|
| 26 |
-
|
| 27 |
-
print("🚀 Starting FastAPI with Gradio...")
|
| 28 |
-
uvicorn.run(app, host="0.0.0.0", port=7860)
|
|
|
|
| 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()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|