Update app.py
Browse files
app.py
CHANGED
@@ -132,15 +132,16 @@ app = FastAPI()
|
|
132 |
|
133 |
@app.post("/text/")
|
134 |
def create_text(text: str):
|
135 |
-
return {"summary":
|
136 |
|
137 |
|
138 |
@app.post("/file/")
|
139 |
def create_upload_file(file: UploadFile = File(...)):
|
140 |
text = file.file.read().decode("utf-8")
|
141 |
-
return {"summary":
|
142 |
-
|
143 |
|
|
|
|
|
144 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
145 |
demo.launch(share=True)
|
146 |
|
|
|
132 |
|
133 |
@app.post("/text/")
|
134 |
def create_text(text: str):
|
135 |
+
return {"summary": translate(text)}
|
136 |
|
137 |
|
138 |
@app.post("/file/")
|
139 |
def create_upload_file(file: UploadFile = File(...)):
|
140 |
text = file.file.read().decode("utf-8")
|
141 |
+
return {"summary": translate(text)}
|
|
|
142 |
|
143 |
+
if __name__ == '__main__':
|
144 |
+
uvicorn.run(app, port=8080, host='0.0.0.0')
|
145 |
demo = gr.Interface(fn=translate, inputs="text", outputs="text")
|
146 |
demo.launch(share=True)
|
147 |
|