Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -1,42 +1,3 @@
|
|
| 1 |
-
# import gradio as gr
|
| 2 |
-
# import os
|
| 3 |
-
|
| 4 |
-
# from langchain_google_genai import GoogleGenerativeAI
|
| 5 |
-
# from langchain import LLMChain
|
| 6 |
-
# from langchain.prompts import ChatPromptTemplate,PromptTemplate,HumanMessagePromptTemplate
|
| 7 |
-
# from langchain.schema import (
|
| 8 |
-
# HumanMessage,
|
| 9 |
-
# SystemMessage
|
| 10 |
-
# )
|
| 11 |
-
|
| 12 |
-
# google_api_key=os.environ["google_api_key"]
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
# llm = GoogleGenerativeAI(model='gemini-1.5-pro', google_api_key=google_api_key)
|
| 16 |
-
|
| 17 |
-
# messages = [
|
| 18 |
-
# SystemMessage(content="You are an expert at extracting entities from text."),
|
| 19 |
-
# HumanMessagePromptTemplate.from_template("{text}")
|
| 20 |
-
# ]
|
| 21 |
-
|
| 22 |
-
# chat_prompt = ChatPromptTemplate.from_messages(messages)
|
| 23 |
-
# chain = LLMChain(llm=llm, prompt=chat_prompt)
|
| 24 |
-
|
| 25 |
-
# def extract_entities(text):
|
| 26 |
-
# result = chain.run(text)
|
| 27 |
-
# return result
|
| 28 |
-
|
| 29 |
-
# def chatbot(text, history):
|
| 30 |
-
# response = extract_entities(text)
|
| 31 |
-
# return response
|
| 32 |
-
|
| 33 |
-
# iface = gr.ChatInterface(
|
| 34 |
-
# fn=chatbot,
|
| 35 |
-
# title="Entity Extraction Chatbot",
|
| 36 |
-
# description="Extract entities from text using Gemini 1.5 Pro."
|
| 37 |
-
# )
|
| 38 |
-
|
| 39 |
-
# iface.launch()
|
| 40 |
import gradio as gr
|
| 41 |
import os
|
| 42 |
|
|
@@ -67,8 +28,8 @@ iface = gr.Interface(
|
|
| 67 |
fn=extract_entities,
|
| 68 |
inputs=gr.Textbox(label="Enter your text"),
|
| 69 |
outputs=gr.Markdown(label="Extracted Entities"),
|
| 70 |
-
title="Entity Extraction Tool",
|
| 71 |
-
description="Extract entities from
|
| 72 |
)
|
| 73 |
|
| 74 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
import gradio as gr
|
| 2 |
import os
|
| 3 |
|
|
|
|
| 28 |
fn=extract_entities,
|
| 29 |
inputs=gr.Textbox(label="Enter your text"),
|
| 30 |
outputs=gr.Markdown(label="Extracted Entities"),
|
| 31 |
+
title="Entity Extraction Tool for Email",
|
| 32 |
+
description="Extract entities from Email using Gemini 1.5 Pro."
|
| 33 |
)
|
| 34 |
|
| 35 |
|