Spaces:
Build error
Build error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,3 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
# Speckle stream and authentication information
|
| 2 |
speckle_token = os.getenv("SPECKLE_TOKEN")
|
| 3 |
speckle_server_url = "https://speckle.xyz/"
|
|
@@ -73,4 +82,15 @@ async def update_streams(request: Request):
|
|
| 73 |
branch_data = extract_branch_info(stream_id, server_url=speckle_server_url, token=speckle_token)
|
| 74 |
await send_data(branch_data)
|
| 75 |
|
| 76 |
-
return "All streams updated successfully!"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
import json
|
| 3 |
+
import requests
|
| 4 |
+
from specklepy.api.client import SpeckleClient
|
| 5 |
+
from fastapi import Request
|
| 6 |
+
import websockets
|
| 7 |
+
import asyncio
|
| 8 |
+
from huggingface_hub import webhook_endpoint
|
| 9 |
+
|
| 10 |
# Speckle stream and authentication information
|
| 11 |
speckle_token = os.getenv("SPECKLE_TOKEN")
|
| 12 |
speckle_server_url = "https://speckle.xyz/"
|
|
|
|
| 82 |
branch_data = extract_branch_info(stream_id, server_url=speckle_server_url, token=speckle_token)
|
| 83 |
await send_data(branch_data)
|
| 84 |
|
| 85 |
+
return "All streams updated successfully!"
|
| 86 |
+
|
| 87 |
+
# Uncomment below if you want to use Gradio for a manual interface
|
| 88 |
+
"""
|
| 89 |
+
import gradio as gr
|
| 90 |
+
iface = gr.Interface(
|
| 91 |
+
fn=update_streams,
|
| 92 |
+
inputs=gr.components.Button(value="Update Streams"),
|
| 93 |
+
outputs="text",
|
| 94 |
+
)
|
| 95 |
+
iface.launch()
|
| 96 |
+
"""
|