Spaces:
Sleeping
Sleeping
test2023h5
commited on
Commit
•
34751a9
1
Parent(s):
f8b8595
Update main.py
Browse files
main.py
CHANGED
@@ -54,6 +54,7 @@ def generate_response(task, text):
|
|
54 |
return generated_texts[0].split('\n')[0]
|
55 |
|
56 |
def predict(text, method):
|
|
|
57 |
'''
|
58 |
# Example usage
|
59 |
prompt = ["Translate to French", "Hello, how are you?"]
|
@@ -107,10 +108,10 @@ async def say_hello():
|
|
107 |
@app.post("/process")
|
108 |
async def process_text(request: ProcessRequest):
|
109 |
if request.method == 0:
|
110 |
-
processed_text = request.text.upper()
|
111 |
processed_text = predict(request.text, 0)
|
112 |
elif request.method == 1:
|
113 |
-
processed_text = request.text.lower()
|
114 |
processed_text = predict(request.text, 1)
|
115 |
elif request.method == 2:
|
116 |
processed_text = request.text[::-1] # 反转字符串
|
|
|
54 |
return generated_texts[0].split('\n')[0]
|
55 |
|
56 |
def predict(text, method):
|
57 |
+
return "hi"
|
58 |
'''
|
59 |
# Example usage
|
60 |
prompt = ["Translate to French", "Hello, how are you?"]
|
|
|
108 |
@app.post("/process")
|
109 |
async def process_text(request: ProcessRequest):
|
110 |
if request.method == 0:
|
111 |
+
#processed_text = request.text.upper()
|
112 |
processed_text = predict(request.text, 0)
|
113 |
elif request.method == 1:
|
114 |
+
#processed_text = request.text.lower()
|
115 |
processed_text = predict(request.text, 1)
|
116 |
elif request.method == 2:
|
117 |
processed_text = request.text[::-1] # 反转字符串
|