Skip to content

Commit

Permalink
remove more redundant code
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderGi committed Sep 20, 2023
1 parent 1547646 commit 792de0d
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 19 deletions.
18 changes: 0 additions & 18 deletions daras_ai_v2/glossary.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,24 +76,6 @@ def glossary_resource(f_url: str = DEFAULT_GLOSSARY_URL):
resource.save()


def _update_or_create_glossary(f_url: str) -> tuple[str, "pd.DataFrame"]:
"""
Update or create a glossary resource
Args:
f_url: url of the glossary file
Returns:
path: path to the glossary resource (for use in translation requests)
df: pandas DataFrame of the glossary
"""
from daras_ai_v2.vector_search import doc_url_to_metadata

print("Updating/Creating glossary...")
f_url = f_url or DEFAULT_GLOSSARY_URL
doc_meta = doc_url_to_metadata(f_url)
df = _update_glossary(f_url, doc_meta)
return _get_glossary(), df


@redis_cache_decorator
def _update_glossary(
f_url: str, doc_meta, glossary_name: str = "glossary"
Expand Down
1 change: 0 additions & 1 deletion glossary_resources/models.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
from django.db import models
from bots.custom_fields import CustomURLField
import uuid
from asgiref.sync import sync_to_async


class GlossaryResources(models.Model):
Expand Down

0 comments on commit 792de0d

Please sign in to comment.