Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -25,4 +25,11 @@ async def analyze(code: str):
|
|
25 |
max_length=512,
|
26 |
num_beams=5
|
27 |
)[0]['generated_text']
|
28 |
-
return {"result": result}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
25 |
max_length=512,
|
26 |
num_beams=5
|
27 |
)[0]['generated_text']
|
28 |
+
return {"result": result}
|
29 |
+
|
30 |
+
|
31 |
+
# 添加GET支持,测试模型
|
32 |
+
@app.get("/analyze")
|
33 |
+
async def analyze_get(code: str): # 新增GET方法
|
34 |
+
return await analyze(code)
|
35 |
+
|