Spaces:
Build error
Build error
Upload folder using huggingface_hub
Browse filesFiles changed (3)
- app.py+14-4
- handler.py+9-8
- ui.py+5-4
1234516 unmodified lines2223242526272829303132333435from fastrtc import Streamfrom fastapi.responses import RedirectResponsefrom gradio.utils import get_spacetry:16 unmodified linesstream.ui = ui@stream.get("/")async def _():url = "/ui" if not get_space() else "https://fastrtc-llama-code-editor.hf.space/ui/"return RedirectResponse(url)if __name__ == "__main__":import uvicornuvicorn.run(stream, host="0.0.0.0", port=7860)12345616 unmodified lines2324252627282930313233343536373839404142434445from fastapi import FastAPIfrom fastapi.responses import RedirectResponsefrom fastrtc import Streamfrom gradio.utils import get_spacetry:16 unmodified linesstream.ui = uiapp = FastAPI()@app.get("/")async def _():url = "/ui" if not get_space() else "https://fastrtc-llama-code-editor.hf.space/ui/"return RedirectResponse(url)if __name__ == "__main__":import osif (mode := os.getenv("MODE")) == "UI":stream.ui.launch(server_port=7860, server_name="0.0.0.0")elif mode == "PHONE":stream.fastphone(host="0.0.0.0", port=7860)else:import uvicornuvicorn.run(app, host="0.0.0.0", port=7860)
12345678910111213141516from fastrtc import (ReplyOnPause,AdditionalOutputs,audio_to_bytes,)import numpy as npimport osimport base64import openaiimport refrom groq import Groqfrom dotenv import load_dotenvfrom pathlib import Pathload_dotenv()1234567891011121314151617import base64import osimport refrom pathlib import Pathimport numpy as npimport openaifrom dotenv import load_dotenvfrom fastrtc import (AdditionalOutputs,ReplyOnPause,audio_to_bytes,)from groq import Groqload_dotenv()
1234567891011121314151617from dotenv import load_dotenvfrom fastrtc import WebRTC, get_twilio_turn_credentialsimport gradio as grfrom gradio.utils import get_spacefrom pathlib import Pathtry:from demo.llama_code_editor.handler import (CodeHandler,system_prompt,display_in_sandbox,)except (ImportError, ModuleNotFoundError):from handler import CodeHandler, system_prompt, display_in_sandboxload_dotenv()123456789101112131415161718from pathlib import Pathimport gradio as grfrom dotenv import load_dotenvfrom fastrtc import WebRTC, get_twilio_turn_credentialsfrom gradio.utils import get_spacetry:from demo.llama_code_editor.handler import (CodeHandler,display_in_sandbox,system_prompt,)except (ImportError, ModuleNotFoundError):from handler import CodeHandler, display_in_sandbox, system_promptload_dotenv()
app.py+14-4
handler.py+9-8
ui.py+5-4