ZakharZokhar commited on
Commit
572d4e2
1 Parent(s): 97480fe

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +7 -0
main.py CHANGED
@@ -14,6 +14,13 @@ def t5(input):
14
  output = pipe_flan(input)
15
  return {"output": output[0]["generated_text"]}
16
 
 
 
 
 
 
 
 
17
  @app.on_event("startup")
18
  async def startup_event():
19
  # Запуск Streamlit в отдельном процессе
 
14
  output = pipe_flan(input)
15
  return {"output": output[0]["generated_text"]}
16
 
17
+ @app.get("/", response_class=HTMLResponse)
18
+ async def streamlit_proxy(request: Request):
19
+ async with httpx.AsyncClient() as client:
20
+ streamlit_url = "http://localhost:8501/"
21
+ response = await client.get(streamlit_url)
22
+ return HTMLResponse(content=response.text, status_code=response.status_code)
23
+
24
  @app.on_event("startup")
25
  async def startup_event():
26
  # Запуск Streamlit в отдельном процессе