Skip to content

Forum in maintenance, we will back soon 🙂

AttributeError: mod...
 
Notifications
Clear all

AttributeError: module 'llm' has no attribute 'llm_generate_text'

6 Posts
4 Users
3 Reactions
325 Views
Jan Rikard Vevang
(@vjanrikard)
Posts: 9
Member
Topic starter
 

Hi, got error in script LLMs:OpenAI,NlpCloud,Cohere

main.py script points to llm.py
line 18, in <module>
open_ai_response = llm.llm_generate_text(prompt, "OpenAI", "gpt-3.5-turbo")
^^^^^^^^^^^^^^^^^^^^^
AttributeError: module 'llm' has no attribute 'llm_generate_text'

main.py
open_ai_response = llm.llm_generate_text(prompt, "OpenAI", "gpt-3.5-turbo")
print(open_ai_response)

llm.py
def llm_generate_text(prompt,service,model):
if service == 'OpenAI':
generated_text = openai_generate(prompt,model)

 
Posted : 01/12/2024 10:48 pm
Topic Tags
Hasan Aboul Hasan
(@admin)
Posts: 1257
Member Admin
 

Please share a screenshot. and you are a power member; please use the premium forum to get better and faster responses. also yo can join our private discord server

 
Posted : 01/13/2024 6:41 am
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@vjanrikard can you please share your code preferably via a public Github link or using the (<>) code icon above.

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/13/2024 4:13 pm
Jan Rikard Vevang
(@vjanrikard)
Posts: 9
Member
Topic starter
 

All good after got access to repository case closed.

 
Posted : 01/13/2024 5:34 pm
(@Anonymous 35336)
Posts: 4
New Member Guest
 

the “hasattr()” function inside the if-else to add logic to our code snippet. This will avoid the AttributeError

 
Posted : 01/26/2024 12:21 pm
SSAdvisor
(@ssadvisor)
Posts: 1139
Noble Member
 

@google-md-hasanmasrur what code are you referring to? Do you have an example you can share?

Regards,
Earnie Boyd, CEO
Seasoned Solutions Advisor LLC
Schedule 1-on-1 help
Join me on Slack

 
Posted : 01/28/2024 3:42 pm
Share: