Spaces:
Build error
Build error
Update app.py
Browse files79 unmodified lines808182838485868788899091929394959697989979 unmodified linesreturn user_inputelse:return "无效的输入类型或未上传文件。"def process_input(input_type, user_input, uploaded_file):print('ooooocr')if input_type == "File Upload" and uploaded_file is not None:# 读取上传的文件with open(uploaded_file.name, "rb") as f:image = f.read()results = reader.readtext(image)# 提取识别的文本extracted_text = ' '.join([text[1] for text in results])print("提取的文本:")print(extracted_text)return extracted_textelif input_type == "Text Input":return user_inputdef toggle_visibility(input_type):user_input_visible = input_type == "Text Input"79 unmodified lines8081828384858679 unmodified linesreturn user_inputelse:return "无效的输入类型或未上传文件。"def toggle_visibility(input_type):user_input_visible = input_type == "Text Input"
app.py+1-14