-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
HF Callback not working with Urdu Text #841
Comments
Taking a look. |
@abidlabs actually can you take a look? It has to do with the HF callback |
Yup I’ll take a look
…On Fri, Mar 18, 2022 at 6:25 PM aliabid94 ***@***.***> wrote:
@abidlabs <https://github.com/abidlabs> actually can you take a look? It
has to do with the HF callback
—
Reply to this email directly, view it on GitHub
<#841 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AANSE6P4NDKE2TSPXE32NCLVAUUJVANCNFSM5RCZ7JRQ>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub>.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @kingabzpro, I tried to reproduce this issue, but was unable to, Specifically, can you try the following code locally and tell me if you run into any errors? (It's just a minimal version of your code) import gradio as gr
def asr(audio):
return "hello"
HF_TOKEN = "" # replace with your token
hf_writer = gr.HuggingFaceDatasetSaver(HF_TOKEN, "Urdu-ASR-flags2")
################### Gradio Web APP ################################
title = "Urdu Automatic Speech Recognition"
description = """
<p>
<center>
This model is a fine-tuned version of facebook/wav2vec2-xls-r-300m on the common_voice dataset.
</center>
</p>
<center>
<img src="https://huggingface.co/spaces/kingabzpro/Urdu-ASR-SOTA/resolve/main/Images/cover.jpg" alt="logo" width="550"/>
</center>
"""
article = "<p style='text-align: center'><a href='https://dagshub.com/kingabzpro/Urdu-ASR-SOTA' target='_blank'>Source Code on DagsHub</a></p><p style='text-align: center'><a href='https://huggingface.co/blog/fine-tune-xlsr-wav2vec2' target='_blank'>Fine-tuning XLS-R for Multi-Lingual ASR with 🤗 Transformers</a></p></center></p>"
examples = [["Sample/sample1.mp3"], ["Sample/sample2.mp3"], ["Sample/sample3.mp3"]]
Input = gr.inputs.Audio(
source="microphone",
type="filepath",
optional=True,
label="Please Record Your Voice",
)
Output = gr.outputs.Textbox(label="Urdu Script")
iface = gr.Interface(
asr,
Input,
Output,
title=title,
flagging_options=["incorrect", "worst", "ambiguous"],
flagging_callback=hf_writer,
description=description,
article=article,
examples=examples,
theme="grass",
)
iface.launch() |
@abidlabs, it worked locally. But my return is Urdu text. If you replace "hello world" with "آپ کیا کر ر" then you will see the error. I think it is also causing HFcallback error. Unicode decode. I tried to normalize text but still face and error.
|
Ahh I see. I'll take a look at resolving unicode issues |
@abidlabs I was able to normalize text, but apart from that, there is another but strange error. When you selected examples. filepath = component.save_flagged(
File "/home/user/.local/lib/python3.8/site-packages/gradio/inputs.py", line 1295, in save_flagged
return self.save_flagged_file(
File "/home/user/.local/lib/python3.8/site-packages/gradio/component.py", line 60, in save_flagged_file
file = processing_utils.decode_base64_to_file(data, encryption_key)
File "/home/user/.local/lib/python3.8/site-packages/gradio/processing_utils.py", line 187, in decode_base64_to_file
data, extension = decode_base64_to_binary(encoding)
File "/home/user/.local/lib/python3.8/site-packages/gradio/processing_utils.py", line 182, in decode_base64_to_binary
data = encoding.split(",")[1] This error occurs when you select the examples and flag them. Again it might be related to unicode. I don't know. |
@abidlabs Assigning it to you since you are taking a look into it, if not feel free to remove it. |
Hi @kingabzpro this fixed now, and the fix will be out as part of Gradio 3.0. Thanks for creating the issue! |
Describe the bug
The call back works fine with vision and chatbot but with ASR it's generating error and I cant seem to figure it out.
Reproduction
Link to app: https://huggingface.co/spaces/kingabzpro/Urdu-ASR-SOTA
Link to dataset: https://huggingface.co/datasets/kingabzpro/Urdu-ASR-flags/tree/main
Screenshot
Logs
System Info
Severity
annoyance
The text was updated successfully, but these errors were encountered: