Michael S. Trusov commited on
Commit
7d1bd50
·
1 Parent(s): 5a86db4

November 3 commit to Hugging Face

Browse files
Files changed (1) hide show
  1. app.py +18 -0
app.py CHANGED
@@ -13,6 +13,24 @@ import json
13
 
14
  #--------------------------------------------------------------------------------
15
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
16
  qs = {}
17
 
18
  theme = gr.themes.Base(
 
13
 
14
  #--------------------------------------------------------------------------------
15
 
16
+ from fastapi import FastAPI
17
+ from fastapi.responses import PlainTextResponse
18
+
19
+ #--------------------------------------------------------------------------------
20
+
21
+
22
+ app = FastAPI()
23
+
24
+ @app.get("/get_log", response_class=PlainTextResponse)
25
+ async def get_log_file():
26
+ try:
27
+ with open("images/log_data.txt", "r") as file:
28
+ return file.read()
29
+ except FileNotFoundError:
30
+ return "Log file not found."
31
+
32
+ #--------------------------------------------------------------------------------
33
+
34
  qs = {}
35
 
36
  theme = gr.themes.Base(