Coder Social home page Coder Social logo

Comments (13)

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024 1

Switch to another Provider from g4f. If it still doesn't work, I recommend opening an issue in the g4f repository.

from moneyprinter.

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024

I assume the other Env variables are set correctly?

from moneyprinter.

Boing7678 avatar Boing7678 commented on August 17, 2024

grafik
this is the whole file, i didn't show the other ones since I wasn't sure wether you could log in into my tiktok using the session ID

from moneyprinter.

TypicalNexus avatar TypicalNexus commented on August 17, 2024

i having the same issue

from moneyprinter.

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024

Does this always happen, or just sometimes?

from moneyprinter.

Boing7678 avatar Boing7678 commented on August 17, 2024

It seems to be random which one I get, but it's always one of them. I haven't been able to create a working video yet.

from moneyprinter.

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024

Try re-cloning MoneyPrinter, re-entering the Environment Variables, and then see if anything changes. I don't really think this is an issue with the code, it's difficult to say at this point. Just make sure that your Pexels API Key is set 100% correctly.

from moneyprinter.

Salty-Coder avatar Salty-Coder commented on August 17, 2024

Had this issue, but only when GPT occasionally returns the json as a markdown string like this:

```json
[
example
]
```

when it should be like this:

[
example
]

from moneyprinter.

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024

Had this issue, but only when GPT occasionally returns the json as a markdown string like this:

json [ example ]

when it should be like this:

[ example ]

Yeah, this is pretty easy to fix.

from moneyprinter.

FujiwaraChoki avatar FujiwaraChoki commented on August 17, 2024

Does this program still work? I never successfully managed to generate a video. It managed to get the search term array, then throw an error.

Of course it works, it has for many, I just refactored the search term extraction using Regex, pull and try again.

from moneyprinter.

tafolau avatar tafolau commented on August 17, 2024

Issue still there. Using g4f.

[*] GPT returned an unformatted response. Attempting to clean...
[-] Error: 'NoneType' object has no attribute 'group'

from moneyprinter.

Salty-Coder avatar Salty-Coder commented on August 17, 2024

Switch to another Provider from g4f. If it still doesn't work, I recommend opening an issue in the g4f repository.

I can't remember exactly, but I believe switching g4f provider was how I fixed it in the end.

from moneyprinter.

tafolau avatar tafolau commented on August 17, 2024

Here's a solution:

try:
    search_terms = json.loads(response)
    if not isinstance(search_terms, list) or not all(isinstance(term, str) for term in search_terms):
        raise ValueError("Response is not a list of strings.")

except (json.JSONDecodeError, ValueError):
    print(colored("[*] GPT returned an unformatted response. Attempting to clean...", "yellow"))

    # Get everything between the first and last square brackets
    response = "[" + response[response.find("[") + 1:response.rfind("]")] + "]"

    try:
        search_terms = json.loads(response)
    except json.JSONDecodeError:
        print(colored("[-] Could not parse response.", "red"))
        return []

from moneyprinter.

Related Issues (20)

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.