davidberenstein1957 HF staff commited on
Commit
2c31d1f
1 Parent(s): a2a6071

Update human feedback collector interface

Browse files
Files changed (3) hide show
  1. README.md +3 -0
  2. app.py +10 -2
  3. chat_interface_preference.py +4 -5
README.md CHANGED
@@ -13,3 +13,6 @@ short_description: LLM, chatbot, human-feedback
13
  ---
14
 
15
  Check out the configuration reference at <https://huggingface.co/docs/hub/spaces-config-reference>
 
 
 
 
13
  ---
14
 
15
  Check out the configuration reference at <https://huggingface.co/docs/hub/spaces-config-reference>
16
+
17
+ > [!WARNING]
18
+ > This is a warning message. Be cautious when proceeding.
app.py CHANGED
@@ -120,8 +120,16 @@ chat_interface = ChatInterface(
120
  ["What are great things cook when getting started with Asian cooking?"],
121
  ["Who was Anthony Bourdain?"],
122
  ],
123
- title="💪🏽🦾 LLM human-feedback collector ChatInterface (DPO) 🦾💪🏽",
124
- description="""This is an adaptation of the gr.ChatInferface which allows for human feedback collection for SFT, DPO and KTO.""",
 
 
 
 
 
 
 
 
125
  )
126
 
127
  with gr.Blocks(css="style.css") as demo:
 
120
  ["What are great things cook when getting started with Asian cooking?"],
121
  ["Who was Anthony Bourdain?"],
122
  ],
123
+ title="💪🏽🦾 Human Feedback Collector | Meta-Llama-3.1-8B-Instruct | (DPO) 🦾💪🏽",
124
+ description="".join(
125
+ [
126
+ "This is an adaptation of the [`gr.ChatInferface`](https://www.gradio.app/docs/gradio/chatinterface) and [`huggingface_hub.CommitScheduler`](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.CommitScheduler) which allows for human feedback collection. ",
127
+ "Another cool tool for capturing Gradio interactions is the [`gr.HuggingFaceDatasetSaver`](https://www.gradio.app/guides/using-flagging#the-hugging-face-dataset-saver-callback). ",
128
+ "This demo shows how you might capture human feedback directly from applications within Gradio. ",
129
+ "The captured feedback can directly be used for fine-tuning LLMs within framework like [transformers](https://github.com/huggingface/transformers), [TRL](https://github.com/huggingface/trl) or [AutoTrain](https://huggingface.co/autotrain), ",
130
+ "however, it might benefit from additional data curation with something like [Argilla](https://github.com/argilla-io/argilla/) for human feedback and/or [distilabel](https://github.com/argilla-io/distilabel/) for AI feedback. Argilla can even be [deployed for free on Hugging Face Spaces](https://argilla-io.github.io/argilla/latest/getting_started/huggingface-spaces/).",
131
+ ]
132
+ ),
133
  )
134
 
135
  with gr.Blocks(css="style.css") as demo:
chat_interface_preference.py CHANGED
@@ -219,14 +219,13 @@ class ChatInterface(Blocks):
219
  with self:
220
  if title:
221
  Markdown(f"<h1 style='text-align: center; margin-bottom: 1rem'>{self.title}</h1>")
222
- if description:
223
- Markdown(description)
224
  if self.commit_scheduler:
225
  Markdown(
226
- f"## Data is being logged to a datset on the hub: [{self.commit_scheduler.repo_id}](https://huggingface.co/datasets/{self.commit_scheduler.repo_id})"
227
  )
228
- Markdown(f"### Techniques: {self.prefence_techniques}")
229
- Markdown(f"### MIN TURNS: {self.min_turns} - MAX TURN: {self.max_turns}")
 
230
  if chatbot:
231
  self.chatbot = chatbot.render()
232
  else:
 
219
  with self:
220
  if title:
221
  Markdown(f"<h1 style='text-align: center; margin-bottom: 1rem'>{self.title}</h1>")
 
 
222
  if self.commit_scheduler:
223
  Markdown(
224
+ f'<center><h2>Data is being logged to <a href="https://huggingface.co/datasets/{self.commit_scheduler.repo_id}">a dataset on the Hugging Face Hub</a></h2></center>'
225
  )
226
+ if description:
227
+ Markdown(description)
228
+
229
  if chatbot:
230
  self.chatbot = chatbot.render()
231
  else: