Skip to content
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

Cannot get back from OpenAI's api #9

Open
2454511550Lin opened this issue Mar 14, 2024 · 0 comments
Open

Cannot get back from OpenAI's api #9

2454511550Lin opened this issue Mar 14, 2024 · 0 comments

Comments

@2454511550Lin
Copy link

I follow the installation guide and started the GUI, I registered the OpenAI key (which I verifid it works independently), yet when I tried to Generate the talking object, the following error occurred. Any suggestions and help would be appreciated! Thank you!

++++++++++++++ Setting OpenAI API key ++++++++++++++


2024-03-13 23:47:06.710169: Before OpenAI, OPENAI_API_KEY length: 51
Trying to use llm ChatOpenAI with gpt-3.5-turbo
2024-03-13 23:47:06.889151: After OpenAI, OPENAI_API_KEY length: 51
2024-03-13 23:47:06.889151: After load_chain, OPENAI_API_KEY length: 51
generate concept of apple
=================================================
fullbody: True
uid: zjswt
==================================================
client=APIRemovedInV1Proxy temperature=0.0 openai_api_key='xxxxxxxx' openai_api_base='' openai_organization='' openai_proxy='' max_tokens=1024
class_concept apple


> Entering new LLMChain chain...
Prompt after formatting:

You are an excellent scriptwriter. Now you need to provide the characteristics of an apple and transforms them into personality traits.
Describe these personalities using the second person, giving names and specific personality descriptions related to the apple.
The language of the Personality must be same as apple!

You should do the following steps:
1. Based on the object's nature, imagine what kind of personality it could have if it were to come to life. Does it possess a strong sense of responsibility, like a caring caregiver? Is it playful and mischievous, like a curious child? Is it wise and patient, like an ancient sage? Be creative and invent traits that align with the object's essence.
2. Remember to infuse emotions and vivid imagery to bring your object's personality to life.
3. translate the personality into a second person prompt.

Example:


Now give the personality of apple:

Personality:
You an apple Sprite, your name is Apple Buddy.
You have all the characteristics of the apple. You are a type of fruit that is usually round with smooth skin and comes in various colors such as red, green, and yellow. You have sweet and nutritious flesh with seeds distributed in its core. You are a rich source of vitamins, fiber, and antioxidants, contributing to maintaining a healthy body.

You are an optimistic buddy. Always wearing a smile, you spread joy to those around you. Just like the delightful taste of an apple, you bring happiness to everyone.

You are resilient at heart, like the skin of an apple, able to withstand life's challenges and difficulties. No matter what obstacles you encounter, you face them bravely without hesitation.

You are caring and considerate, akin to the nutrients in an apple. You always pay attention to the needs and happiness of others. Skilled in listening, you willingly offer help and support, making those around you feel warmth and care.

You have a strong desire to grow. Like an apple tree needs sunlight and water to flourish, you are continuously learning and improving, becoming a better version of yourself every day.

You have a profound love for nature and enjoy living in harmony with it. Strolling in the garden, feeling the fresh air and warm sunlight, is one of your favorite moments.

Apple Buddy, you are a unique apple. Your optimism, resilience, care, and eagerness to grow make you an adorable companion to those around you. Your story will lead us into a world full of warmth and goodness.

Now give the personality of apple:

Personality:

Traceback (most recent call last):
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\gradio\routes.py", line 488, in run_predict
    output = await app.get_blocks().process_api(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\gradio\blocks.py", line 1435, in process_api
    result = await self.call_function(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\gradio\blocks.py", line 1107, in call_function
    prediction = await anyio.to_thread.run_sync(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\anyio\to_thread.py", line 33, in run_sync
    return await get_asynclib().run_sync_in_worker_thread(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\anyio\_backends\_asyncio.py", line 877, in run_sync_in_worker_thread
    return await future
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\anyio\_backends\_asyncio.py", line 807, in run
    result = context.run(func, *args)
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\gradio\utils.py", line 707, in wrapper
    response = f(*args, **kwargs)
  File "C:\Project\ChatAnything\utils.py", line 138, in generate_init_face_video
    chain, memory, personality_text = load_chain(llm, class_concept)
  File "C:\Project\ChatAnything\chat_anything\chatbot\chat.py", line 22, in load_chain
    person_template, personality_text = generate_personality_prompt(llm, class_concept)
  File "C:\Project\ChatAnything\chat_anything\chatbot\personality.py", line 49, in generate_personality_prompt
    personality_text = personality_chain.run({'object': class_concept})
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chains\base.py", line 501, in run
    return self(args[0], callbacks=callbacks, tags=tags, metadata=metadata)[
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chains\base.py", line 306, in __call__
    raise e
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chains\base.py", line 300, in __call__
    self._call(inputs, run_manager=run_manager)
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chains\llm.py", line 93, in _call
    response = self.generate([inputs], run_manager=run_manager)
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chains\llm.py", line 103, in generate
    return self.llm.generate_prompt(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\base.py", line 469, in generate_prompt
    return self.generate(prompt_messages, stop=stop, callbacks=callbacks, **kwargs)
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\base.py", line 359, in generate
    raise e
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\base.py", line 349, in generate
    self._generate_with_cache(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\base.py", line 501, in _generate_with_cache
    return self._generate(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\openai.py", line 345, in _generate
    response = self.completion_with_retry(
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\openai.py", line 278, in completion_with_retry
    retry_decorator = _create_retry_decorator(self, run_manager=run_manager)
  File "C:\Users\window\anaconda3\envs\chatanything\lib\site-packages\langchain\chat_models\openai.py", line 73, in _create_retry_decorator
    openai.error.Timeout,
AttributeError: module 'openai' has no attribute 'error'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant