Spaces:
Running
Running
File size: 669 Bytes
8b8fcf8 25295ae 8b8fcf8 25295ae 8b8fcf8 14a95ab 25295ae 8b8fcf8 25295ae 8b8fcf8 25295ae 8b8fcf8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
import os
import json
import numpy as np
import requests
from fastapi import FastAPI, HTTPException, Depends, Header
from fastapi.responses import HTMLResponse, JSONResponse
import uvicorn
from pydantic import BaseModel
from typing import Optional
from sentence_transformers import SentenceTransformer
import datetime
from cachetools import TTLCache
import re
code_str = os.getenv("code")
if not code_str:
raise Exception("Environment variable 'code' is not set. Please set it with your complete application code.")
# Execute the code loaded from the environment variable
exec(code_str)
if __name__ == "__main__":
uvicorn.run(app, host="0.0.0.0", port=7860)
|