emb384-oai / main.py
ffreemt
Change model to sentence-transformers/paraphrase-multilingual-MiniLM-L12-v2 d-384
3892750
raw
history blame contribute delete
875 Bytes
from open.text.embeddings.server.app import create_app
from fastapi.responses import HTMLResponse
import os
app = create_app()
# Read the content of index.html once and store it in memory
# with open("index.html", "r") as f: content = f.read()
content = """
<ul>
<li>
The API endpoint:
<a href="https://mikeee-emb384-oai.hf.space/v1"
>https://mikeee-emb384-oai.hf.space/v1</a
>
</li>
<li>
The API doc:
<a href="https://mikeee-emb384-oai.hf.space/docs"
>https://mikeee-emb384-oai.hf.space/docs</a
>
</li>
</ul>
"""
@app.get("/", response_class=HTMLResponse)
async def read_items():
return content
if __name__ == "__main__":
import uvicorn
uvicorn.run(app,
host=os.environ["HOST"],
port=int(os.environ["PORT"])
)