Skip to content
This repository was archived by the owner on Nov 3, 2023. It is now read-only.

Reverting emoji response patch in model chat #4934

Merged
merged 1 commit into from
Jan 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@

import React from "react";

import InputEmoji from 'react-input-emoji'
import { Button, Col, ControlLabel, Form, FormControl, FormGroup } from "react-bootstrap";


Expand Down Expand Up @@ -161,7 +160,7 @@ function FinalSurvey({ taskConfig, onMessageSend, active, currentCheckboxes }) {
}
}

function CheckboxTextResponse({ onMessageSend, taskConfig, active, currentCheckboxes }) {
function CheckboxTextResponse({ onMessageSend, active, currentCheckboxes }) {
const [textValue, setTextValue] = React.useState("");
const [sending, setSending] = React.useState(false);

Expand Down Expand Up @@ -197,56 +196,32 @@ function CheckboxTextResponse({ onMessageSend, taskConfig, active, currentCheckb
[tryMessageSend]
);

if (taskConfig.emoji_picker){
return (
<div className="response-type-module">
<div className="response-bar">
<InputEmoji
value={textValue}
className="response-text-input"
onEnter={(e) => handleKeyPress(e)}
onChange={setTextValue}
placeholder="Please enter here..."
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
</div>
);
} else {
return (
<div className="response-type-module">
<div className="response-bar">
return (
<div className="response-type-module">
<div className="response-bar">
<FormControl
type="text"
className="response-text-input"
inputRef={(ref) => {
inputRef.current = ref;
}}
value={textValue}
placeholder="Please enter here..."
onKeyPress={(e) => handleKeyPress(e)}
onChange={(e) => setTextValue(e.target.value)}
disabled={!active || sending}
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
type="text"
className="response-text-input"
inputRef={(ref) => {
inputRef.current = ref;
}}
value={textValue}
placeholder="Please enter here..."
onKeyPress={(e) => handleKeyPress(e)}
onChange={(e) => setTextValue(e.target.value)}
disabled={!active || sending}
/>
<Button
className="btn btn-primary submit-response"
id="id_send_msg_button"
disabled={textValue === "" || !active || sending}
onClick={() => tryMessageSend()}
>
Send
</Button>
</div>
);
}
</div>
);
}

function ResponseComponent({ taskConfig, appSettings, onMessageSend, active }) {
Expand All @@ -272,7 +247,6 @@ function ResponseComponent({ taskConfig, appSettings, onMessageSend, active }) {
return (
<CheckboxTextResponse
onMessageSend={onMessageSend}
taskConfig={taskConfig}
active={computedActive}
currentCheckboxes={lastMessageAnnotations}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ mephisto:
conversation_start_mode: 'hi'
annotation_question: Does this comment from your partner have any of the following attributes? (Check all that apply)
conversations_needed_string: "blender_90M:10"
emoji_picker: false
task:
allowed_concurrent: 1
assignment_duration_in_seconds: 600
Expand Down
5 changes: 0 additions & 5 deletions parlai/crowdsourcing/tasks/model_chat/model_chat_blueprint.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,10 +155,6 @@ class BaseModelChatBlueprintArgs(ParlAIChatBlueprintArgs):
"in order to override the parlai parser defaults."
},
)
emoji_picker: bool = field(
default=False,
metadata={"help": "Show emoji picker."},
)


class BaseModelChatBlueprint(ParlAIChatBlueprint, ABC):
Expand Down Expand Up @@ -299,7 +295,6 @@ def get_frontend_args(self) -> Dict[str, Any]:
"frame_height": 650,
"final_rating_question": self.args.blueprint.final_rating_question,
"block_mobile": True,
"emoji_picker": self.args.blueprint.emoji_picker,
}


Expand Down