tkellogg / fossil

A mastodon client optimized for reading, with an AI-enabled algorithm for displaying posts
https://www.fossil-social.com
65 stars 8 forks source link

Redid Configuration Code, Edits for Using Local Models, and Minor Cleaning #20

Closed golfinq closed 6 months ago

golfinq commented 6 months ago

As discussed in https://github.com/tkellogg/fossil/issues/15#issuecomment-1881460619 the configuration variables were not propagating into the code. I fixed this by creating a configuration manager object which performs a series of look ups when asked for a specific variable from the configuration state: first from the sqllite database, then from the .env file, and finally from the host environment.

I also had to change the way the reduction step works to use the session_id and to account for models not found in tiktoken. Additionally, I sorted the imports using isort, changed "embedding model" to "summarizing model" in the settings page, and added a tqdm progress bar to the summarization step.

golfinq commented 6 months ago

I didn't know if I should make the *_MODEL accessors functions or properties. I figured making them functions was safer as to not leak state accidentally.

tkellogg commented 6 months ago

oh wow, it'll take me a bit to work through this one. I'll get to it later

tkellogg commented 6 months ago

Looks good, merged. I fixed one edge case