ozgrozer / ai-renamer

A Node.js CLI that uses Ollama and LM Studio models (Llava, Gemma, Llama etc.) to intelligently rename files by their contents
https://x.com/ozgrozer/status/1812591967756255298
GNU General Public License v3.0
1.44k stars 89 forks source link

Dataseries json will fail. #2

Closed HorusPi closed 1 month ago

HorusPi commented 2 months ago

Json data documents constructed as such [{"Fecha":"05/09/2021 17:24:51","Resultado":251.05},{"Fecha":"05/09/2021 17:25:12","Resultado":270.09},....]

Fails with this message ENOENT: no such file or directory, rename 'E:\Documentos\test\mediciones-potencia.json' -> 'E:\Documentos\test\Here is a concise, descriptive filename in kebab-case format:

2021-09-05-scores.json

This filename includes the date (YYYY-MM-DD) and the type of data being stored (scores). The .json extension indicates that the file contains JSON-formatted data..json'

Not sure why it fails but here it is. And thanks for the work!

HorusPi commented 2 months ago

Also , a collection of links to different versions of a virtual office inside an iframe gave the same error and died ENOENT: no such file or directory, rename 'E:\Documentos\test\ov.html' -> 'E:\Documentos\test\Here are a few options for a concise, descriptive filename in kebab-case format:

Of these options, I think the most descriptive and concise would be "links-frames-pages". This filename clearly indicates that the content contains a collection of links to external pages, some of which are framed in iframes..html'

Some error handling to allow the program to continue after the AI fails to provide an answer would be a valid option.

ozgrozer commented 2 months ago

What LLM you're using? Sometimes it makes the filenames like in the first example you gave.

HorusPi commented 2 months ago

What LLM you're using? Sometimes it makes the filenames like in the first example you gave.

Llama3:8b

Also , just point out that I'm using an old as time RTX 1050 with 2Gb RAM , so llama3 is barely working, and more like slogging it out , but that's on me :)

ozgrozer commented 2 months ago

I'm trying to figure out what causes that long filenames. I think it's because of large files.

HorusPi commented 2 months ago

I'm trying to figure out what causes that long filenames. I think it's because of large files.

Unlikely , the first was 9k (measures json) ,an the second is 13k (html)

ozgrozer commented 2 months ago

Sometimes LLMs are just not obeying the prompt. Maybe prompt needs to be updated.

ozgrozer commented 2 months ago

I've made an update to slice the LLM result here. Even though it generates a long name, it won't add to the filename.