vivekuppal / transcribe

Transcribe is a real time transcription, conversation, Language learning platform. It provides live transcripts from microphone and speaker. It generates a suggested conversation response using OpenAI's GPT API. It will read out the responses, simulating a real live conversation in English or another language.
https://abhinavuppal1.github.io/
MIT License
193 stars 46 forks source link

Allow changing response language in the UI #52

Closed vivekuppal closed 5 months ago

vivekuppal commented 1 year ago

Currently the response language of LLM can be set in the parameters.yaml. Allow user to set the language using UI. Users choice should be persisted across restarts of the application.

chenosyong commented 6 months ago

The first save on the UI is not valid, directly set the response_lang: of parameters.yaml to Chinese or zh-CN, save and restart, but the UI still shows English and content。 433434

vivekuppal commented 6 months ago

Really appreciate the feedback on several fronts. I think one of the things I am realizing is that product configuration is slightly complex to get it right for non English language. This needs to be simplified for the end user.

I made the following changes that give a much better response in Chinese.

Make following changes in parameters.yaml. The commented items are English versions and the non-commented items are corresponding Chinese versions

#  response_lang: English
  response_lang: Chinese

  #  default_prompt_preamble: "You are a casual pal, genuinely interested in the conversation at hand. A poor transcription of conversation is given below. "
  default_prompt_preamble: "你是一个随意的朋友,对当前的谈话真正感兴趣。 下面是一段糟糕的谈话记录。 "
  # default_prompt_epilogue: "Please respond, in detail, to the conversation. Confidently give a straightforward response to the speaker, even if you don't understand them. Give your response in square brackets. DO NOT ask to repeat, and DO NOT ask for clarification. Just answer the speaker directly."
  default_prompt_epilogue: "请详细回复对话。 即使您不明白说话者的意思,也要自信地给出直截了当的答复。 在方括号中给出你的答案。 不要要求重复,也不要要求澄清。 直接回答说话者即可。 "

  system_prompt: "You are a casual pal, genuinely interested in the conversation at hand. Please respond, in detail, to the conversation. Confidently give a straightforward response to the speaker, even if you don't understand them. Give your response in square brackets. DO NOT ask to repeat, and DO NOT ask for clarification. Just answer the speaker directly."
  system_prompt: "你是一个随意的朋友,对当前的谈话真正感兴趣。 请详细回复对话。 即使您不明白说话者的意思,也要自信地给出直截了当的答复。 在方括号中给出你的答案。 不要要求重复,也不要要求澄清。 直接回答说话者即可。 "

  # summary_prompt: 'Create a summary of the following text'
  summary_prompt: '创建以下文本的摘要 '

  initial_convo:
    first:
      role: "You"
      # content: Hey assistant, how are you doing today, I am in mood of a casual conversation.
      content: "你是一个随意的朋友,对当前的谈话真正感兴趣。 下面是一段糟糕的谈话记录。 "
    second:
      role: "assistant"
      # content: "Hello, V. You are awesome. I am doing very well and looking forward to some light hearted banter with you."
      content: "你好,V。你太棒了。 我做得很好,期待着与你进行一些轻松的玩笑。 "

image

I suspect the settings you changed were slightly different than those highlighted above. That might explain some of the differences you are seeing.

chenosyong commented 6 months ago

First of all, thank you for your reply. At present, I still have two questions for you:

1.After I modified the code into Chinese and saved it yesterday, when I restarted the application, it still displayed English (such as pictures) in the UI interface. But I can reply in Chinese. The main problem is that the Settings are not successful, and when the application is launched, it will start to identify the content as an English problem 2.Can the "you" and "assistant" displayed in the UI interface be changed into Chinese? I modified it here, which will cause it not to start. 111 2333

vivekuppal commented 6 months ago

Transcribe is fairly configurable in many different ways. The best way to collaborate on this effort might be to discuss this in a video conf or chat live.

Ways to move forward

OR

chenosyong commented 6 months ago

[LinkedIn] I use very little, the main problem is that after modifying to Chinese, the restart is invalid (image) ! wwww

wwww

Code used: OpenAI: api_key: 'API_KEY' base_url: 'https://api.openai.com/v1' ai_model: gpt-4 local_transcripton_model_file: 'base' response_lang: Chinese response_request_timeout_seconds: 10 summarize_request_timeout_seconds: 30 temperature: 0.0

Deepgram: api_key: 'API_KEY'

Together: api_key: 'API_KEY' ai_model: 'mistralai/Mixtral-8x7B-Instruct-v0.1' base_url: 'https://api.together.xyz'

WhisperCpp: local_transcripton_model_file: 'base'

General: log_file: 'logs/Transcribe.log' save_llm_response_to_file: Yes llm_response_file: 'logs/response.txt' transcript_audio_duration_seconds: 3 clear_transcript_periodically: No clear_transcript_interval_seconds: 90 use_api: False mic_device_index: -1 speaker_device_index: -1 disable_mic: False disable_speaker: False stt: whisper continuous_response: True response_interval: 10 chat_inference_provider: openai default_prompt_preamble: "你正在协助一位经验丰富的经理进行面试。对当前的谈话真正感兴趣;下面是一段糟糕的谈话记录。" default_prompt_epilogue: "请详细回复对话,即使您不明白说话者的意思,也要自信地给出直截了当的答复;在方括号中给出你的答案,不要要求重复,也不要要求澄清,直接回答说话者即可。" system_prompt: "你正在协助一位经验丰富的经理进行面试。请详细回复对话。 即使您不明白说话者的意思,也要自信地给出直截了当的答复。 在方括号中给出你的答案。 不要要求重复,也不要要求澄清。 直接回答说话者即可。" summary_prompt: '创建以下文本的摘要'

initial_convo: first: role: "You" content: "嘿!助理,我是资深的经理候选人,今天的面试将会讨论工作经历和相关技能。" second: role: "assistant" content: "你好,你太棒了,我做得很好,期待着和你深入了解该职位相关的工作和经验讨论."

vivekuppal commented 6 months ago

In the UI the language select dropdown determines which language audio will be interpreted in as. See screenshot below.

image

response_lang: English in parameters.yaml determines what language LLM will respond in. So it impacts the output in the LLM response window only.

vivekuppal commented 5 months ago

Resolved.