Spaces:
Sleeping
Sleeping
Update alternative.py
Browse files- alternative.py +4 -8
alternative.py
CHANGED
|
@@ -54,7 +54,7 @@ HUGGINGFACEHUB_API_TOKEN = os.getenv('HUGGINGFACEHUB_API_TOKEN')
|
|
| 54 |
# Initialize the model instances
|
| 55 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
|
| 56 |
llm_model_instance = HuggingFaceEndpoint(
|
| 57 |
-
repo_id=repo_id,
|
| 58 |
)
|
| 59 |
|
| 60 |
embedder_model_instance = HuggingFaceInferenceAPIEmbeddings(
|
|
@@ -150,8 +150,8 @@ choices = [
|
|
| 150 |
]
|
| 151 |
|
| 152 |
# Create the Gradio interface with tabs
|
| 153 |
-
with gr.Blocks() as demo:
|
| 154 |
-
gr.Markdown("#
|
| 155 |
|
| 156 |
with gr.Tabs():
|
| 157 |
# Tab 1: Data Extraction
|
|
@@ -171,11 +171,7 @@ with gr.Blocks() as demo:
|
|
| 171 |
)
|
| 172 |
|
| 173 |
# Tab 2: Website Scraping and Summarization
|
| 174 |
-
with gr.TabItem("
|
| 175 |
-
gr.Markdown("# Scrape websites, no-code version")
|
| 176 |
-
gr.Markdown("""Easily scrape and summarize web content using advanced AI models on the Hugging Face Hub without writing any code. Input your desired prompt and source URL to get started.
|
| 177 |
-
This is a no-code version of the excellent lib [ScrapeGraphAI](https://github.com/VinciGit00/Scrapegraph-ai).
|
| 178 |
-
It's a basic demo and a work in progress. Please contribute to it to make it more useful!""")
|
| 179 |
with gr.Row():
|
| 180 |
with gr.Column():
|
| 181 |
model_dropdown = gr.Textbox(label="Model", value="Mistral-7B-Instruct-v0.2")
|
|
|
|
| 54 |
# Initialize the model instances
|
| 55 |
repo_id = "mistralai/Mistral-7B-Instruct-v0.2"
|
| 56 |
llm_model_instance = HuggingFaceEndpoint(
|
| 57 |
+
repo_id=repo_id, model_kwargs={"temperature": 0.5, "max_length": 8192, "token": HUGGINGFACEHUB_API_TOKEN}
|
| 58 |
)
|
| 59 |
|
| 60 |
embedder_model_instance = HuggingFaceInferenceAPIEmbeddings(
|
|
|
|
| 150 |
]
|
| 151 |
|
| 152 |
# Create the Gradio interface with tabs
|
| 153 |
+
with gr.Blocks(theme="sudeepshouche/minimalist") as demo:
|
| 154 |
+
gr.Markdown("# THE BIG SCRAPER")
|
| 155 |
|
| 156 |
with gr.Tabs():
|
| 157 |
# Tab 1: Data Extraction
|
|
|
|
| 171 |
)
|
| 172 |
|
| 173 |
# Tab 2: Website Scraping and Summarization
|
| 174 |
+
with gr.TabItem("Scraping & Summarization"):
|
|
|
|
|
|
|
|
|
|
|
|
|
| 175 |
with gr.Row():
|
| 176 |
with gr.Column():
|
| 177 |
model_dropdown = gr.Textbox(label="Model", value="Mistral-7B-Instruct-v0.2")
|