Update main.py
Browse files
main.py
CHANGED
@@ -103,7 +103,7 @@ class Word_BERT(nn.Module):
|
|
103 |
ly_transfer = self.ly_transfer(pool)
|
104 |
return out,cancer,transfer,ly_transfer
|
105 |
|
106 |
-
def getChat(text):
|
107 |
# while True:
|
108 |
# if True:
|
109 |
# text = input("user:")
|
@@ -141,7 +141,7 @@ def getChat(text):
|
|
141 |
end = i
|
142 |
size_list.append((start,end))
|
143 |
start = end
|
144 |
-
print(size_list)
|
145 |
|
146 |
cancer_dict = {'θ
Ίη': 0, 'θΊθ―ζ§ηΎη
': 1, 'ι³η': 2, 'ζ ζ³ε€ζη»η»εε': 3, 'ε€εε': 4, '转移η': 5, 'ε°η»θη': 6, '倧η»θη': 7}
|
147 |
id_cancer = {j:i for i,j in cancer_dict.items()}
|
@@ -175,13 +175,13 @@ def model_init():
|
|
175 |
return model
|
176 |
# return None
|
177 |
|
178 |
-
|
179 |
-
print(os.getcwd())
|
180 |
|
181 |
@app.get("/infer_t5")
|
182 |
def t5(input):
|
183 |
-
|
184 |
-
|
|
|
185 |
|
186 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
187 |
|
|
|
103 |
ly_transfer = self.ly_transfer(pool)
|
104 |
return out,cancer,transfer,ly_transfer
|
105 |
|
106 |
+
def getChat(text,model):
|
107 |
# while True:
|
108 |
# if True:
|
109 |
# text = input("user:")
|
|
|
141 |
end = i
|
142 |
size_list.append((start,end))
|
143 |
start = end
|
144 |
+
# print(size_list)
|
145 |
|
146 |
cancer_dict = {'θ
Ίη': 0, 'θΊθ―ζ§ηΎη
': 1, 'ι³η': 2, 'ζ ζ³ε€ζη»η»εε': 3, 'ε€εε': 4, '转移η': 5, 'ε°η»θη': 6, '倧η»θη': 7}
|
147 |
id_cancer = {j:i for i,j in cancer_dict.items()}
|
|
|
175 |
return model
|
176 |
# return None
|
177 |
|
178 |
+
model_extra = model_init()
|
|
|
179 |
|
180 |
@app.get("/infer_t5")
|
181 |
def t5(input):
|
182 |
+
r1,r2,r3,r4 = getChat(input,model_extra)
|
183 |
+
# output = pipe_flan(input)
|
184 |
+
return {"output": r4}
|
185 |
|
186 |
app.mount("/", StaticFiles(directory="static", html=True), name="static")
|
187 |
|