Skip to content

Commit

Permalink
Merge pull request #155 from dara-network/add_metadata_images
Browse files Browse the repository at this point in the history
  • Loading branch information
devxpy authored Sep 25, 2023
2 parents 7b6199d + 8203765 commit 957b9a9
Show file tree
Hide file tree
Showing 10 changed files with 46 additions and 3 deletions.
5 changes: 5 additions & 0 deletions recipes/DocExtract.py
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
from daras_ai_v2.vector_search import doc_url_to_metadata, DocMetadata
from recipes.DocSearch import render_documents

DEFAULT_YOUTUBE_BOT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/6c8f6876-538c-11ee-bea7-02420a000195/youtube%20bot%201.png.png"


class Columns(IntegerChoices):
webpage_url = 1, "Source"
Expand Down Expand Up @@ -82,6 +84,9 @@ class RequestModel(BaseModel):
class ResponseModel(BaseModel):
pass

def preview_image(self, state: dict) -> str | None:
return DEFAULT_YOUTUBE_BOT_META_IMG

def render_form_v2(self):
document_uploader(
"##### 🤖 Youtube URLS",
Expand Down
5 changes: 4 additions & 1 deletion recipes/DocSummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
)
from recipes.GoogleGPT import render_output_with_refs, GoogleGPTPage

DEFAULT_DOC_SEARCH_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/assets/DOC%20SEARCH.gif"
DEFAULT_DOC_SUMMARY_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/db70c56e-585a-11ee-990b-02420a00018f/doc%20summary.png.png"


class CombineDocumentsChains(Enum):
Expand Down Expand Up @@ -78,6 +78,9 @@ class ResponseModel(BaseModel):
prompt_tree: PromptTree | None
final_prompt: str

def preview_image(self, state: dict) -> str | None:
return DEFAULT_DOC_SUMMARY_META_IMG

def render_form_v2(self):
document_uploader("##### 📎 Documents")
st.text_area("##### 👩‍💻 Instructions", key="task_instructions", height=150)
Expand Down
5 changes: 5 additions & 0 deletions recipes/Lipsync.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@

CREDITS_PER_MB = 2

DEFAULT_LIPSYNC_GIF = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/91acbbde-5857-11ee-920a-02420a000194/lipsync%20audio.png.png"


class LipsyncPage(BasePage):
title = "Lip Syncing"
Expand All @@ -33,6 +35,9 @@ class RequestModel(BaseModel):
class ResponseModel(BaseModel):
output_video: str

def preview_image(self, state: dict) -> str | None:
return DEFAULT_LIPSYNC_GIF

def render_form_v2(self) -> bool:
st.file_uploader(
"""
Expand Down
4 changes: 4 additions & 0 deletions recipes/QRCodeGenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
from daras_ai_v2.loom_video_widget import youtube_video

ATTEMPTS = 1
DEFAULT_QR_CODE_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/f09c8cfa-5393-11ee-a837-02420a000190/ai%20art%20qr%20codes1%201.png.png"


class QRCodeGeneratorPage(BasePage):
Expand Down Expand Up @@ -89,6 +90,9 @@ class ResponseModel(BaseModel):
shortened_url: str | None
cleaned_qr_code: str

def preview_image(self, state: dict) -> str | None:
return DEFAULT_QR_CODE_META_IMG

def related_workflows(self) -> list:
from recipes.CompareText2Img import CompareText2ImgPage
from recipes.CompareUpscaler import CompareUpscalerPage
Expand Down
5 changes: 4 additions & 1 deletion recipes/RelatedQnA.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from recipes.GoogleGPT import GoogleGPTPage
from recipes.RelatedQnADoc import render_qna_outputs

DEFAULT_GOOGLE_GPT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/assets/WEBSEARCH%20%2B%20CHATGPT.jpg"
DEFAULT_SEO_CONTENT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/9b415768-5393-11ee-a837-02420a000190/RQnA%20SEO%20content%201.png.png"


class RelatedGoogleGPTResponse(GoogleGPTPage.ResponseModel):
Expand Down Expand Up @@ -46,6 +46,9 @@ class ResponseModel(BaseModel):
output_queries: list[RelatedGoogleGPTResponse]
serp_results: dict

def preview_image(self, state: dict) -> str | None:
return DEFAULT_SEO_CONTENT_META_IMG

def render_description(self) -> str:
return "This workflow gets the related queries for your Google search, searches your custom domain and builds answers using the results and GPT."

Expand Down
5 changes: 4 additions & 1 deletion recipes/RelatedQnADoc.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from recipes.DocSearch import DocSearchPage, render_doc_search_step, EmptySearchResults
from recipes.GoogleGPT import render_output_with_refs, GoogleSearchMixin

DEFAULT_GOOGLE_GPT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/assets/WEBSEARCH%20%2B%20CHATGPT.jpg"
DEFAULT_QNA_DOC_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/bab3dd2a-538c-11ee-920f-02420a00018e/RQnA-doc%20search%201.png.png"


class RelatedDocSearchResponse(DocSearchPage.ResponseModel):
Expand Down Expand Up @@ -43,6 +43,9 @@ class ResponseModel(BaseModel):
output_queries: list[RelatedDocSearchResponse]
serp_results: dict

def preview_image(self, state: dict) -> str | None:
return DEFAULT_QNA_DOC_META_IMG

def render_description(self) -> str:
return "This workflow gets the related queries for your Google search, searches your custom domain and builds answers using the results and GPT."

Expand Down
5 changes: 5 additions & 0 deletions recipes/SmartGPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
from daras_ai_v2.language_model_settings_widgets import language_model_settings
from daras_ai_v2.pt import PromptTree

DEFAULT_SMARTGPT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/e02d1582-538a-11ee-9d7b-02420a000194/smartgpt%201.png.png"


class SmartGPTPage(BasePage):
title = "SmartGPT"
Expand Down Expand Up @@ -45,6 +47,9 @@ class ResponseModel(BaseModel):

prompt_tree: PromptTree | None

def preview_image(self, state: dict) -> str | None:
return DEFAULT_SMARTGPT_META_IMG

def render_form_v2(self):
st.text_area(
"""
Expand Down
5 changes: 5 additions & 0 deletions recipes/Text2Audio.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
num_outputs_setting,
)

DEFAULT_TEXT2AUDIO_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/ddc6e894-538b-11ee-a837-02420a000190/text2audio1%201.png.png"


class Text2AudioModels(Enum):
audio_ldm = "AudioLDM (CVSSP)"
Expand Down Expand Up @@ -58,6 +60,9 @@ class ResponseModel(BaseModel):
typing.Literal[tuple(e.name for e in Text2AudioModels)], list[str]
]

def preview_image(self, state: dict) -> str | None:
return DEFAULT_TEXT2AUDIO_META_IMG

def render_form_v2(self):
st.text_area(
"""
Expand Down
5 changes: 5 additions & 0 deletions recipes/VideoBots.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
from recipes.TextToSpeech import TextToSpeechPage
from url_shortener.models import ShortenedURL

DEFAULT_COPILOT_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/c8b24b0c-538a-11ee-a1a3-02420a00018d/meta%20tags1%201.png.png"

BOT_SCRIPT_RE = re.compile(
# start of line
r"^"
Expand Down Expand Up @@ -255,6 +257,9 @@ class ResponseModel(BaseModel):
final_search_query: str | None
final_keyword_query: str | None

def preview_image(self, state: dict) -> str | None:
return DEFAULT_COPILOT_META_IMG

def related_workflows(self):
from recipes.LipsyncTTS import LipsyncTTSPage
from recipes.CompareText2Img import CompareText2ImgPage
Expand Down
5 changes: 5 additions & 0 deletions recipes/asr.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@
from daras_ai_v2.text_output_widget import text_outputs
from recipes.DocSearch import render_documents

DEFAULT_ASR_META_IMG = "https://storage.googleapis.com/dara-c1b52.appspot.com/daras_ai/media/3b98d906-538b-11ee-9c77-02420a000193/Speech1%201.png.png"


class AsrPage(BasePage):
title = "Speech Recognition & Translation"
Expand All @@ -43,6 +45,9 @@ class ResponseModel(BaseModel):
raw_output_text: list[str] | None
output_text: list[str | AsrOutputJson]

def preview_image(self, state: dict) -> str | None:
return DEFAULT_ASR_META_IMG

def preview_description(self, state: dict):
return "Transcribe mp3, WhatsApp audio + wavs with OpenAI's Whisper or AI4Bharat / Bhashini ASR models. Optionally translate to any language too."

Expand Down

0 comments on commit 957b9a9

Please sign in to comment.