AMKCode commited on
Commit
44fe74d
1 Parent(s): 257411c

rewrote demo with with

Browse files
Files changed (1) hide show
  1. app.py +18 -9
app.py CHANGED
@@ -69,7 +69,7 @@ QUANTIZATIONS = ["q0f16",
69
  "q4f32_1",
70
  "q4f16_awq"]
71
 
72
- def button_click(profile: gr.OAuthProfile | None, hf_model_id, conv_template, quantization, oauth_token: gr.OAuthToken | None):
73
  if not oauth_token.token:
74
  raise ValueError("Log in to Huggingface to use this")
75
 
@@ -102,13 +102,22 @@ def button_click(profile: gr.OAuthProfile | None, hf_model_id, conv_template, qu
102
 
103
  return "successful"
104
 
105
- demo = gr.Interface(
106
- fn=button_click,
107
- inputs = [gr.LoginButton(),
108
- gr.Textbox(label="HF Model ID"),
109
- gr.Dropdown(CONV_TEMPLATES, label="Conversation Template"),
110
- gr.Dropdown(QUANTIZATIONS, label="Quantization Method")],
111
- outputs = "text"
112
- )
 
 
 
 
 
 
 
 
 
113
 
114
  demo.launch()
 
69
  "q4f32_1",
70
  "q4f16_awq"]
71
 
72
+ def button_click(hf_model_id, conv_template, quantization, oauth_token: gr.OAuthToken | None):
73
  if not oauth_token.token:
74
  raise ValueError("Log in to Huggingface to use this")
75
 
 
102
 
103
  return "successful"
104
 
105
+ # demo = gr.Interface(
106
+ # fn=button_click,
107
+ # inputs = [gr.LoginButton(),
108
+ # gr.Textbox(label="HF Model ID"),
109
+ # gr.Dropdown(CONV_TEMPLATES, label="Conversation Template"),
110
+ # gr.Dropdown(QUANTIZATIONS, label="Quantization Method")],
111
+ # outputs = "text"
112
+ # )
113
+
114
+ with gr.Blocks() as demo:
115
+ gr.LoginButton()
116
+ model_id = gr.Textbox(label="HF Model ID")
117
+ conv = gr.Dropdown(CONV_TEMPLATES, label="Conversation Template")
118
+ quant = gr.Dropdown(QUANTIZATIONS, label="Quantization Method")
119
+ btn = gr.Button("Convert!")
120
+ out = gr.Textbox()
121
+ btn.click(fn=button_click , inputs=[model_id, conv, quant], outputs=out)
122
 
123
  demo.launch()