Update app.py
Browse files
app.py
CHANGED
|
@@ -118,7 +118,7 @@ def predict_next(text, num_tokens, temperature):
|
|
| 118 |
return result[len(text):].strip()
|
| 119 |
|
| 120 |
|
| 121 |
-
with gr.Blocks(
|
| 122 |
gr.Markdown("# 🔍 Token Probability Explorer & Predictor\nPaste text, **hover** to preview or **click** a token to pin its tooltip open. Click elsewhere to dismiss.")
|
| 123 |
|
| 124 |
text_input = gr.Textbox(label="Input Text", placeholder="Paste your text here…", lines=5)
|
|
@@ -138,4 +138,9 @@ with gr.Blocks(theme=gr.themes.Soft(), css="footer{display:none!important}.main{
|
|
| 138 |
btn_analyze.click(fn=analyze_text, inputs=[text_input, top_k_input], outputs=output_analysis)
|
| 139 |
btn_predict.click(fn=predict_next, inputs=[text_input, num_tokens_input, temperature_input], outputs=output_prediction)
|
| 140 |
|
| 141 |
-
demo.launch(
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
return result[len(text):].strip()
|
| 119 |
|
| 120 |
|
| 121 |
+
with gr.Blocks() as demo:
|
| 122 |
gr.Markdown("# 🔍 Token Probability Explorer & Predictor\nPaste text, **hover** to preview or **click** a token to pin its tooltip open. Click elsewhere to dismiss.")
|
| 123 |
|
| 124 |
text_input = gr.Textbox(label="Input Text", placeholder="Paste your text here…", lines=5)
|
|
|
|
| 138 |
btn_analyze.click(fn=analyze_text, inputs=[text_input, top_k_input], outputs=output_analysis)
|
| 139 |
btn_predict.click(fn=predict_next, inputs=[text_input, num_tokens_input, temperature_input], outputs=output_prediction)
|
| 140 |
|
| 141 |
+
demo.launch(
|
| 142 |
+
server_name="0.0.0.0",
|
| 143 |
+
server_port=7860,
|
| 144 |
+
theme=gr.themes.Soft(),
|
| 145 |
+
css="footer{display:none!important}.main{max-width:960px;margin:auto}"
|
| 146 |
+
)
|