Hi, I have a problem with setting the language in the gpt_dog.py file. Any country code not entered in the LANGUAGE = variable returns an error “not defined”, for example:
Traceback (most recent call last):
File “/home/sabek/pidog/gpt_examples/gpt_dog.py”, line 38, in
LANGUAGE = [zh]
^^
NameError: name ‘zh’ is not defined
That’s correct.
The issue arises because you used the syntax [zh] directly in your Python code, but zh has not been defined as a variable or string. In Python, if you want to represent a list of strings, you should enclose the strings in quotes.
You might have written it like this: LANGUAGE = [zh] # Incorrect: zh has not been defined as a variable
The correct way is: LANGUAGE = ["zh"] # Correct: “zh” is included as a string in the list
For a multilingual list: LANGUAGE = ["zh", "en"] # Bilingual in Chinese and English
Please check line 38 of your gpt_dog.py file to ensure that all language codes are enclosed in quotes as strings.