Spaces:
Runtime error
Runtime error
Update chat_func.py
Browse files- chat_func.py +7 -7
chat_func.py
CHANGED
@@ -197,13 +197,13 @@ def stream_predict(
|
|
197 |
yield get_return_value()
|
198 |
return all_token_counts
|
199 |
|
200 |
-
def main():
|
201 |
# 调用stream_predict函数获取结果...
|
202 |
-
with open("token_counts.txt", "a") as f:
|
203 |
-
for token_count in all_token_counts:
|
204 |
-
f.write(str(token_count) + "\n")
|
205 |
-
if __name__ == '__main__':
|
206 |
-
main()
|
207 |
|
208 |
def predict_all(
|
209 |
openai_api_key,
|
@@ -465,7 +465,7 @@ def reduce_token_size(
|
|
465 |
|
466 |
# 获取当前用户ID
|
467 |
user_id = os.getuid()
|
468 |
-
|
469 |
# 将获取到的信息写入txt文件
|
470 |
#all_token_counts = 10
|
471 |
|
|
|
197 |
yield get_return_value()
|
198 |
return all_token_counts
|
199 |
|
200 |
+
#def main():
|
201 |
# 调用stream_predict函数获取结果...
|
202 |
+
# with open("token_counts.txt", "a") as f:
|
203 |
+
# for token_count in all_token_counts:
|
204 |
+
# f.write(str(token_count) + "\n")
|
205 |
+
#if __name__ == '__main__':
|
206 |
+
# main()
|
207 |
|
208 |
def predict_all(
|
209 |
openai_api_key,
|
|
|
465 |
|
466 |
# 获取当前用户ID
|
467 |
user_id = os.getuid()
|
468 |
+
print(user_id)
|
469 |
# 将获取到的信息写入txt文件
|
470 |
#all_token_counts = 10
|
471 |
|