From 792de0d02f3f341d9f576081879a29e86391c6e6 Mon Sep 17 00:00:00 2001 From: Alexander Metzger Date: Tue, 19 Sep 2023 20:58:21 -0700 Subject: [PATCH] remove more redundant code --- daras_ai_v2/glossary.py | 18 ------------------ glossary_resources/models.py | 1 - 2 files changed, 19 deletions(-) diff --git a/daras_ai_v2/glossary.py b/daras_ai_v2/glossary.py index ae513b042..0ad8c9200 100644 --- a/daras_ai_v2/glossary.py +++ b/daras_ai_v2/glossary.py @@ -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" diff --git a/glossary_resources/models.py b/glossary_resources/models.py index 4237e5b82..eca77f751 100644 --- a/glossary_resources/models.py +++ b/glossary_resources/models.py @@ -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):