Update main.py
Browse files
main.py
CHANGED
|
@@ -4,24 +4,25 @@ import os
|
|
| 4 |
|
| 5 |
app = create_app(
|
| 6 |
Settings(
|
| 7 |
-
n_threads=
|
| 8 |
model="model/gguf-model.gguf",
|
| 9 |
embedding=True
|
|
|
|
|
|
|
| 10 |
)
|
| 11 |
)
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
|
|
|
|
|
|
| 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)
|
|
|
|
|
|
|
|
|