Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,7 @@
|
|
1 |
from fastapi import FastAPI, HTTPException
|
2 |
from transformers import AutoModelForSeq2SeqLM
|
3 |
from IndicTransToolkit import IndicProcessor
|
|
|
4 |
|
5 |
model = AutoModelForSeq2SeqLM.from_pretrained("ai4bharat/indictrans2-en-indic-1B", trust_remote_code=True)
|
6 |
ip = IndicProcessor(inference=True)
|
@@ -9,7 +10,7 @@ app = FastAPI()
|
|
9 |
|
10 |
# Define request body with Pydantic
|
11 |
class InputData(BaseModel):
|
12 |
-
sentences: str
|
13 |
target_lang: str
|
14 |
|
15 |
# API endpoint to receive input and return predictions
|
|
|
1 |
from fastapi import FastAPI, HTTPException
|
2 |
from transformers import AutoModelForSeq2SeqLM
|
3 |
from IndicTransToolkit import IndicProcessor
|
4 |
+
from typing import List
|
5 |
|
6 |
model = AutoModelForSeq2SeqLM.from_pretrained("ai4bharat/indictrans2-en-indic-1B", trust_remote_code=True)
|
7 |
ip = IndicProcessor(inference=True)
|
|
|
10 |
|
11 |
# Define request body with Pydantic
|
12 |
class InputData(BaseModel):
|
13 |
+
sentences: List[str]
|
14 |
target_lang: str
|
15 |
|
16 |
# API endpoint to receive input and return predictions
|