htahir1 commited on
Commit
c9b4c7c
1 Parent(s): 6e82229

Upload folder using huggingface_hub

Browse files
Files changed (2) hide show
  1. app.py +10 -2
  2. config.json +1 -1
app.py CHANGED
@@ -57,6 +57,12 @@ import gradio as gr
57
  default="This is an awesome journey, I love it!",
58
  help="Comma-separated list of examples to show in the Gradio interface.",
59
  )
 
 
 
 
 
 
60
  def sentiment_analysis(
61
  tokenizer_name_or_path: Optional[str],
62
  model_name_or_path: Optional[str],
@@ -64,7 +70,8 @@ def sentiment_analysis(
64
  title: Optional[str],
65
  description: Optional[str],
66
  interpretation: Optional[str],
67
- examples: Optional[str],
 
68
  ):
69
  """Launches a Gradio interface for sentiment analysis.
70
 
@@ -79,6 +86,7 @@ def sentiment_analysis(
79
  title (str): Title of the Gradio interface.
80
  description (str): Description of the Gradio interface.
81
  interpretation (str): Interpretation mode for the Gradio interface.
 
82
  examples (str): Comma-separated list of examples to show in the Gradio interface.
83
  """
84
  labels = labels.split(",")
@@ -125,7 +133,7 @@ def sentiment_analysis(
125
  else:
126
  client = Client()
127
  latest_run = client.get_pipeline(
128
- "sentinment_analysis_deploy_pipeline", version=1
129
  ).runs[0]
130
  endpoint_name = (
131
  latest_run.steps["deploy_hf_to_sagemaker"]
 
57
  default="This is an awesome journey, I love it!",
58
  help="Comma-separated list of examples to show in the Gradio interface.",
59
  )
60
+ @click.option(
61
+ "--pipeline_version",
62
+ default="3",
63
+ help="Which version of the deploy pipeline should be deployed.",
64
+ type=int
65
+ )
66
  def sentiment_analysis(
67
  tokenizer_name_or_path: Optional[str],
68
  model_name_or_path: Optional[str],
 
70
  title: Optional[str],
71
  description: Optional[str],
72
  interpretation: Optional[str],
73
+ pipeline_version: int,
74
+ examples: Optional[str]
75
  ):
76
  """Launches a Gradio interface for sentiment analysis.
77
 
 
86
  title (str): Title of the Gradio interface.
87
  description (str): Description of the Gradio interface.
88
  interpretation (str): Interpretation mode for the Gradio interface.
89
+ pipeline_version (int): Which pipeline version to user
90
  examples (str): Comma-separated list of examples to show in the Gradio interface.
91
  """
92
  labels = labels.split(",")
 
133
  else:
134
  client = Client()
135
  latest_run = client.get_pipeline(
136
+ "sentinment_analysis_deploy_pipeline", version=pipeline_version
137
  ).runs[0]
138
  endpoint_name = (
139
  latest_run.steps["deploy_hf_to_sagemaker"]
config.json CHANGED
@@ -1,5 +1,5 @@
1
  {
2
- "_name_or_path": "/tmp/tmpt8pu8z7z",
3
  "activation": "gelu",
4
  "architectures": [
5
  "DistilBertForSequenceClassification"
 
1
  {
2
+ "_name_or_path": "/tmp/tmp_qeo33wh",
3
  "activation": "gelu",
4
  "architectures": [
5
  "DistilBertForSequenceClassification"