File size: 469 Bytes
1286203
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
065b0d2
 
 
 
 
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
import re
import urllib
import json
from fastapi import FastAPI, HTTPException, Query
from fastapi.middleware.cors import CORSMiddleware

app = FastAPI()

# Enable CORS
app.add_middleware(
    CORSMiddleware,
    allow_origins=["*"],
    allow_credentials=True,
    allow_methods=["*"],
    allow_headers=["*"],
)



@app.get("/e5_embeddings")
def e5_embeddings(query: str = Query(...)):
    if query:
        return query
    else:
        return "Hello From HF"