matthoffner commited on
Commit
883ba9d
·
verified ·
1 Parent(s): 76fb5c4

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +15 -14
main.py CHANGED
@@ -4,24 +4,25 @@ import os
4
 
5
  app = create_app(
6
  Settings(
7
- n_threads=2, # set to number of cpu cores
8
  model="model/gguf-model.gguf",
9
  embedding=True
 
 
10
  )
11
  )
12
-
13
- # Read the content of index.html once and store it in memory
14
- with open("index.html", "r") as f:
15
- content = f.read()
16
-
17
-
18
- @app.get("/", response_class=HTMLResponse)
19
- async def read_items():
20
- return content
 
 
21
 
22
  if __name__ == "__main__":
23
  import uvicorn
24
- uvicorn.run(app,
25
- host=os.environ["HOST"],
26
- port=int(os.environ["PORT"])
27
- )
 
4
 
5
  app = create_app(
6
  Settings(
7
+ n_threads=4,
8
  model="model/gguf-model.gguf",
9
  embedding=True
10
+ n_gpu_layers=33,
11
+
12
  )
13
  )
14
+
15
+ @app.get('/', response_class=HTMLResponse)
16
+ def custom_index_route():
17
+ html_content = """
18
+ <html>
19
+ <body>
20
+ <iframe src="/docs" frameborder="0" width="100%" height="100%"></iframe>
21
+ </body>
22
+ </html>
23
+ """
24
+ return HTMLResponse(content=html_content)
25
 
26
  if __name__ == "__main__":
27
  import uvicorn
28
+ uvicorn.run(app, host="0.0.0.0", port=7860)