Giter VIP home page Giter VIP logo

langchain-gpt4free's People

Contributors

antoniosabbatellauni avatar ludobico avatar midoribin avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

langchain-gpt4free's Issues

Error while running sample/llm_sample.py

Traceback (most recent call last):
File "/root/langchain-gpt4free/sample/llm_sample.py", line 18, in main()

File "/root/langchain-gpt4free/sample/llm_sample.py", line 8, in main llm: LLM = G4FLLM(

File "/root/tempo-env/lib/python3.10/site-packages/langchain/load/serializable.py", line 74, in init super().init(**kwargs)

File "/root/tempo-env/lib/python3.10/site-packages/pydantic/v1/main.py", line 341, in init raise validation_error pydantic.v1.error_wrappers.ValidationError: 1 validation error for G4FLLM provider instance of module expected (type=type_error.arbitrary_type; expected_arbitrary_type=module)

fine-tuning

Is it possible to fine-tune a gpt4free model with langchain-gpt4free?

Error in G4FLLM._call: Aichat is not working

I get
Error in G4FLLM._call: Aichat is not working, trying 1 of 5
Error in G4FLLM._call: Aichat is not working, trying 2 of 5
Error in G4FLLM._call: Aichat is not working, trying 3 of 5
Error in G4FLLM._call: Aichat is not working, trying 4 of 5
Error in G4FLLM._call: Aichat is not working, trying 5 of 5

LangChainDeprecationWarning

LangChainDeprecationWarning: The function __call__ was deprecated in LangChain 0.1.7 and will be removed in 0.2.0. Use invoke instead.
warn_deprecated(

cannot import name 'Model' from 'g4f'

Traceback (most recent call last):
File "/home/firas/Data/firas/tools/chatgpt-clone/main.py", line 1, in
from g4f import Provider, Model
ImportError: cannot import name 'Model' from 'g4f' (/home/firas/Data/firas/tools/chatgpt-clone/venv/lib/python3.11/site-packages/g4f/init.py)

This isn't an issue, but rather solving some problems that I had: '/Werror=incompatible-pointer-types' and 'C:\\Users\\Name\\AppData\\Roaming\\..\\Local\\Google\\Chrome\\User Data\\Profile 1\\Network\\Cookies'

The first was this error on the C++ compiler: '/Werror=incompatible-pointer-types'
The second the was this: 'C:\Users\Name\AppData\Roaming\..\Local\Google\Chrome\User Data\Profile 1\Network\Cookies'

The first issue is solved by downloading this and then extracting it: https://github.com/PetterS/quickjs/files/12180440/quickjs-1.19.2-cp311-cp311-win_amd64.zip
You then "pip install path-to-said-file"

The second issue is solved by simply closing Chrome completely.

I have to thank you guys very much for this. This will be very useful in my projects to come.

ValidationError: 3 validation errors for G4FLLM

running script:

from g4f import Provider, models
from langchain.llms.base import LLM
from langchain_g4f import G4FLLM
def main():
llm: LLM = G4FLLM(
model=models.gpt_35_turbo,
provider=Provider.Aichat,
)
res = llm("hello")
print(res) # Hello! How can I assist you today?

main()

ValidationError: 3 validation errors for G4FLLM
model -> best_provider
subclass of BaseProvider expected (type=type_error.subclass; expected_class=BaseProvider)
model -> best_provider
wrong tuple length 12, expected 1 (type=value_error.tuple.length; actual_length=12; expected_length=1)
model
str type expected (type=type_error.str)

KeyError: 'message'

When implementing your provided code for summarization, I encountered an error in response. The error message was as follows:
KeyError: 'message'
I have attempted various solutions to rectify this issue, but I have not been successful in resolving it. I kindly request your assistance in addressing this matter.

Here is the code that I have utilized:
llm = G4FLLM(
model=models.gpt_35_turbo,
provider=Provider.Aichat,
)

def summarize_pdf(pdf_file_path):
loader = PyPDFLoader(pdf_file_path)
docs = loader.load_and_split()
chain = load_summarize_chain(llm, chain_type="map_reduce")
summary = chain.run(docs)
return summary

summarize = summarize_pdf("war_update.pdf")
print(summarize)

Issue with the basic chatbot

When I started talking with the basic openai chatbot after 10 questions this pop up and now I can't ask anything for it Error:
Error in G4FLLM._call: Error Response: {'response': False, 'quota': {'total': 10, 'left': 0}, 'error': 'quota'}, trying 1 of 5
Error in G4FLLM._call: Error Response: {'response': False, 'quota': {'total': 10, 'left': 0}, 'error': 'quota'}, trying 2 of 5
Error in G4FLLM._call: Error Response: {'response': False, 'quota': {'total': 10, 'left': 0}, 'error': 'quota'}, trying 3 of 5
Error in G4FLLM._call: Error Response: {'response': False, 'quota': {'total': 10, 'left': 0}, 'error': 'quota'}, trying 4 of 5
Error in G4FLLM._call: Error Response: {'response': False, 'quota': {'total': 10, 'left': 0}, 'error': 'quota'}, trying 5 of 5
Can someone help me how to fix the error?

TypeError: '_InterfaceMetaClass' object is not iterable

Traceback (most recent call last):
File "E:\my program\python\aiyz_dabai_backen\g4f_llm\WorkOrder_Processing_Robot.py", line 1, in
from g4f import Provider, models
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\g4f_init_.py", line 2, in
from . import models
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\g4f\models.py", line 3, in
from .Provider import Bard, BaseProvider, GetGpt, H2o, Liaobots, Vercel, Equing
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\g4f\Provider_init_.py", line 21, in
from .OpenaiChat import OpenaiChat
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\g4f\Provider\OpenaiChat.py", line 3, in
from curl_cffi.requests import AsyncSession
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\curl_cffi\requests_init_.py", line 19, in
from .session import AsyncSession, BrowserType, Session
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\curl_cffi\requests\session.py", line 19, in
import gevent
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_init_.py", line 71, in
from gevent._config import config
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_config.py", line 730, in
Loop().get()
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_config.py", line 151, in get
self.value = self.validate(self._default())
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_config.py", line 259, in validate
return self._import_one_of([self.shortname_map.get(x, x) for x in value])
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_config.py", line 230, in _import_one_of
return self._import_one(item)
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent_config.py", line 248, in import_one
module = importlib.import_module(module)
File "D:\Python310\lib\importlib_init
.py", line 126, in import_module
return _bootstrap.gcd_import(name[level:], package, level)
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\gevent\libuv\loop.py", line 13, in
from zope.interface import implementer
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\zope\interface_init
.py", line 53, in
from zope.interface.interface import Interface
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\zope\interface\interface.py", line 682, in
class InterfaceClass(_InterfaceClassBase):
File "E:\my program\python\aiyz_dabai_backen\venv\lib\site-packages\zope\interface\interface.py", line 641, in new
kind = type.new(cls, name, bases, attrs)
TypeError: '_InterfaceMetaClass' object is not iterable

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.