mirror of
https://github.com/hiyouga/LLaMA-Factory.git
synced 2025-12-29 10:10:35 +08:00
[assets] update readme (#8529)
This commit is contained in:
@@ -12,6 +12,7 @@
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
import inspect
|
||||
import json
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
@@ -50,7 +51,14 @@ def create_chat_box(
|
||||
) -> tuple["Component", "Component", dict[str, "Component"]]:
|
||||
lang = engine.manager.get_elem_by_id("top.lang")
|
||||
with gr.Column(visible=visible) as chat_box:
|
||||
chatbot = gr.Chatbot(type="messages", show_copy_button=True)
|
||||
kwargs = {}
|
||||
if "show_copy_button" in inspect.signature(gr.Chatbot.__init__).parameters:
|
||||
kwargs["show_copy_button"] = True
|
||||
|
||||
if "resizable" in inspect.signature(gr.Chatbot.__init__).parameters:
|
||||
kwargs["resizable"] = True
|
||||
|
||||
chatbot = gr.Chatbot(type="messages", **kwargs)
|
||||
messages = gr.State([])
|
||||
with gr.Row():
|
||||
with gr.Column(scale=4):
|
||||
|
||||
Reference in New Issue
Block a user