File size: 850 Bytes
071ba00
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
from modal import Image, asgi_app, App, Secret

app = App("opensorus-server")

image = Image.debian_slim().pip_install(
    "fastapi",
    "uvicorn",
    "cryptography==45.0.3",
    "gradio==5.33.0",
    "llama_index==0.12.40",
    "llama_index.llms.mistralai",
    "llama_index.embeddings.mistralai",
    "mistralai==1.8.1",
    "PyJWT==2.10.1",
    "python-dotenv==1.1.0",
    "scikit-learn==1.6.1",
    "requests==2.32.3"
)

image = image.add_local_python_source("server")
image = image.add_local_python_source("agent")
image = image.add_local_python_source("tools")
image = image.add_local_python_source("config")


@app.function(image=image, secrets=[Secret.from_name("SECRET")])
@asgi_app()
def fastapi_app():
    import sys
    sys.path.append("/root")
    from server.main import app
    return app

if __name__ == "__main__":
    app.serve()