asv7j commited on
Commit
8d628f4
1 Parent(s): 31cb606

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -10
app.py CHANGED
@@ -1,13 +1,10 @@
1
- from fastapi import FastAPI, HTTPException
2
- from libretranslate import LibreTranslate
3
 
4
  app = FastAPI()
5
- translator = LibreTranslate()
6
 
7
- @app.get("/translate/")
8
- async def translate_text(text: str, source_lang: str = "auto", target_lang: str = "en"):
9
- try:
10
- translation = translator.translate(text, source_lang=source_lang, target_lang=target_lang)
11
- return {"translation": translation}
12
- except Exception as e:
13
- raise HTTPException(status_code=500, detail=str(e))
 
1
+ from fastapi import FastAPI
2
+ import subprocess
3
 
4
  app = FastAPI()
 
5
 
6
+ subprocess.Popen(['python', 'main.py'])
7
+
8
+ @app.get("/")
9
+ def greet_json():
10
+ return {"Hello": "World!"}