Skip to content

Commit

Permalink
Added images and huggingface files
Browse files Browse the repository at this point in the history
  • Loading branch information
PaletiKrishnasai committed Dec 25, 2023
1 parent a2b9c61 commit 78d694f
Show file tree
Hide file tree
Showing 8 changed files with 50 additions and 0 deletions.
1 change: 1 addition & 0 deletions HuggingFace/Dialogue_Summarizer_notebook.ipynb

Large diffs are not rendered by default.

29 changes: 29 additions & 0 deletions HuggingFace/HuggingFaceSpacesApp.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import streamlit as st
from transformers import pipeline


# Function to load the model
@st.cache_data
def load_model():
summarizer = pipeline("text2text-generation", model="pk248/pegasus-samsum")
return summarizer


# Load the model
model = load_model()

# Streamlit UI
st.title("Dialogue Summarization App")
st.write("This app uses the pk248/pegasus-samsum model to summarize coversations.")

# Text input
user_input = st.text_area("Enter text to summarize:", height=200)

# Summarize button
if st.button("Summarize"):
if user_input:
# Model inference
summary = model(user_input, max_length=1000, min_length=5, length_penalty=2.0)
st.write(summary[0]["generated_text"])
else:
st.write("Please enter some text to summarize.")
5 changes: 5 additions & 0 deletions HuggingFace/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
huggingface_hub
python-dotenv
streamlit
transformers
torch
15 changes: 15 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,18 @@ These are the steps that should be followed while implementing each step in the
AWS_ECR_LOGIN_URI = demo>> 566373416292.dkr.ecr.ap-south-1.amazonaws.com

ECR_REPOSITORY_NAME = simple-app

# 8. HuggingFace:

The HuggingFace Folder contains the files required to push to HuggingFace Hub and deploy the model card Spaces.

Dialogue_Summarizer_notebook : Contains the complete codebase to train, finetune and push to hub.

HuggingFaceSpacesApp: Contains the complete Application code to host on HuggingFace Spaces. (Just rename the file to app.py while hosting)

requirements.txt : Contains the requirements for the hugging face application. (Upload the file to spaces folder).

# 9. Corresponding Images:

![Github Actions Deployement](/images/GithubActions_2.png)
*CI-CD pipeline through Github Actions*
Binary file added images/AWS_hosted.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/GithubActions.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/GithubActions_2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added images/HuggingFaceSpacesDemoApp.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 78d694f

Please sign in to comment.