Spaces:
Runtime error
Runtime error
model change
Browse files
main.py
CHANGED
|
@@ -2,15 +2,13 @@ from fastapi import FastAPI, HTTPException
|
|
| 2 |
from pydantic import BaseModel
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
import numpy as np
|
| 5 |
-
from huggingface_hub import hf_hub_download
|
| 6 |
-
from huggingface_hub import HfApi, HfFolder, Repository, hf_hub_url, cached_download
|
| 7 |
|
| 8 |
# Initialize the FastAPI app
|
| 9 |
app = FastAPI()
|
| 10 |
|
| 11 |
# Load the pre-trained SentenceTransformer model from Hugging Face
|
| 12 |
-
|
| 13 |
-
model
|
| 14 |
|
| 15 |
# Define the request body schema
|
| 16 |
class TextInput(BaseModel):
|
|
|
|
| 2 |
from pydantic import BaseModel
|
| 3 |
from sentence_transformers import SentenceTransformer
|
| 4 |
import numpy as np
|
|
|
|
|
|
|
| 5 |
|
| 6 |
# Initialize the FastAPI app
|
| 7 |
app = FastAPI()
|
| 8 |
|
| 9 |
# Load the pre-trained SentenceTransformer model from Hugging Face
|
| 10 |
+
|
| 11 |
+
model=SentenceTransformer("all-MiniLM-L6-V2")
|
| 12 |
|
| 13 |
# Define the request body schema
|
| 14 |
class TextInput(BaseModel):
|