Fix merge conflict in text_generation
- Need to update `shared.still_streaming = False` before the final `yield formatted_outputs`, shifted the position of some yields.
This commit is contained in:
commit
b3e10e47c0
10 changed files with 298 additions and 155 deletions
18
extensions/llama_prompts/script.py
Normal file
18
extensions/llama_prompts/script.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
import gradio as gr
|
||||
import modules.shared as shared
|
||||
import pandas as pd
|
||||
|
||||
df = pd.read_csv("https://raw.githubusercontent.com/devbrones/llama-prompts/main/prompts/prompts.csv")
|
||||
|
||||
def get_prompt_by_name(name):
|
||||
if name == 'None':
|
||||
return ''
|
||||
else:
|
||||
return df[df['Prompt name'] == name].iloc[0]['Prompt'].replace('\\n', '\n')
|
||||
|
||||
def ui():
|
||||
if not shared.args.chat or share.args.cai_chat:
|
||||
choices = ['None'] + list(df['Prompt name'])
|
||||
|
||||
prompts_menu = gr.Dropdown(value=choices[0], choices=choices, label='Prompt')
|
||||
prompts_menu.change(get_prompt_by_name, prompts_menu, shared.gradio['textbox'])
|
Loading…
Add table
Add a link
Reference in a new issue